How to use the popmotion.detectFlow function in popmotion

To help you get started, we’ve selected a few popmotion 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 Popmotion / popmotion / packages / popmotion-on-screen / src / on-screen.js View on Github external
export const trackPosition = (element, callbacks) => {
    const flow = detectFlow(element);

    if (!hasInitialised) {
        init();
    }

    for (let key in callbacks) {
        if (callbacks.hasOwnProperty(key)) {
            flow[key] = callbacks[key];
        }
    }

    flow.onScreenTrackId = elementsToCheck.push(flow);
};
github Popmotion / popmotion / packages / popmotion-react-dom / src / flow-transition-group-component.js View on Github external
childWillAppear(node, onComplete) {
    if (this.props.onMount) {
      this.props.onMount(node);
    }

    if (this.props.enterOnMount) {
      if (this.props.mountValues) {
        const nodeFlow = detectFlow(node);

        nodeFlow.set({
          values: this.props.mountValues
        });
      }

      this.childWillEnter(node, onComplete);
    } else {
      onComplete();
    }
  }
github Popmotion / popmotion / packages / popmotion-react-dom / src / flow-transition-group-component.js View on Github external
startAction(node, action, onComplete) {
    const nodeFlow = detectFlow(node);
    const connectedAction = nodeFlow.connect(action);
    connectedAction.onComplete = onComplete;
    connectedAction.start();
  }
github Popmotion / popmotion / packages / popmotion-react-dom / src / flow-component.js View on Github external
componentDidMount() {
    this.flow = detectFlow(this.getNode());
    this.setValues(this.props.values);

    if (this.props.actions) {
      this.props.actions.forEach((action) => this.startAction(action));
    }
  }
github Popmotion / popmotion / packages / popmotion-on-screen / src / on-screen.js View on Github external
export const stopTracking = (element) => {
    const flow = detectFlow(element);
    delete elementsToCheck[flow.onScreenTrackId];
};
github Popmotion / popmotion / packages / popmotion-react-dom / src / Motion.js View on Github external
componentDidMount() {
    this.flow = detectFlow(findDOMNode(this));
    this.setValues(this.props.currentState);
  }