How to use the framesync.postRender function in framesync

To help you get started, we’ve selected a few framesync examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github framer / motion / src / value / index.ts View on Github external
if (this.children) {
            this.children.forEach(this.setChild)
        }

        if (render && this.renderSubscribers) {
            this.renderSubscribers.forEach(this.notifySubscriber)
        }

        // Update timestamp
        const { delta, timestamp } = getFrameData()

        if (this.lastUpdated !== timestamp) {
            this.timeDelta = delta
            this.lastUpdated = timestamp
            sync.postRender(this.scheduleVelocityCheck)
        }
    }
github aholachek / animate-css-grid / src / index.ts View on Github external
update: (transforms: Coords) => {
                applyCoordTransform(el, transforms);
                // this helps prevent layout thrashing
                sync.postRender(() => recordPositions([el]));
              },
              complete: cachedResolve,
github Popmotion / popmotion / packages / popmotion / src / reactions / value.ts View on Github external
  scheduleVelocityCheck = () => sync.postRender(this.velocityCheck);
github Popmotion / popmotion / packages / popmotion / src / reactions / value.ts View on Github external
update(v: Value) {
    super.update(v);
    this.prev = this.current;
    this.updateCurrent(v);
    const { delta, timestamp } = getFrameData();
    this.timeDelta = delta;
    this.lastUpdated = timestamp;
    sync.postRender(this.scheduleVelocityCheck);
  }
github framer / motion / src / value / index.ts View on Github external
    private scheduleVelocityCheck = () => sync.postRender(this.velocityCheck)