How to use the popmotion.action 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 lennerd / git-for-beginners / src / models / chapters / gitInATeamChapter.js View on Github external
action(({ complete }) => {
            chain(
              this.checkoutMaster,
              popmotionAction(({ complete }) => {
                console.log('commit create without reset');
                this.vis.createCommit(null, false);
                complete();
              }),
              this.checkoutNewFeature,
            ).start({ complete });
          }),
        ),
github lennerd / git-for-beginners / src / models / chapters / gitInATeamChapter.js View on Github external
this.createNewFeatureBranch = popmotionAction(({ complete }) => {
      this.vis.createBranch('new-feature');
      complete();
    });

    this.createCommit = popmotionAction(({ complete }) => {
      this.vis.createCommit();
      complete();
    });

    this.checkoutNewFeature = popmotionAction(({ complete }) => {
      this.vis.checkout('new-feature');
      complete();
    });

    this.checkoutMaster = popmotionAction(({ complete }) => {
      this.vis.checkout('master');
      complete();
    });

    this.mergeNewFeature = popmotionAction(({ complete }) => {
      this.vis.merge('new-feature');
      complete();
    });
  },
  [readOn]() {
github lennerd / git-for-beginners / src / models / chapters / gitInATeamChapter.js View on Github external
[init]() {
    this.vis.showBranches = true;
    this.actionQueue = actionQueue().start();

    this.createNewFeatureBranch = popmotionAction(({ complete }) => {
      this.vis.createBranch('new-feature');
      complete();
    });

    this.createCommit = popmotionAction(({ complete }) => {
      this.vis.createCommit();
      complete();
    });

    this.checkoutNewFeature = popmotionAction(({ complete }) => {
      this.vis.checkout('new-feature');
      complete();
    });

    this.checkoutMaster = popmotionAction(({ complete }) => {
      this.vis.checkout('master');
github lennerd / git-for-beginners / src / models / chapters / workingInATeamChapter.js View on Github external
this.downloadToUserB = popmotionAction(({ complete }) => {
      this.visUserB.add(this.visFile);
      complete();
    });

    this.modify = popmotionAction(({ complete }) => {
      this.visFile.modify();
      complete();
    });

    this.uploadData = popmotionAction(({ complete }) => {
      this.visCloud.add(this.visFile);
      complete();
    });

    this.storeCloudFile = popmotionAction(({ complete }) => {
      this.visCloud.add(this.visCloudFile);
      complete();
    });

    this.storeUserBFile = popmotionAction(({ complete }) => {
      this.visUserB.add(this.visUserFileB);
      complete();
    });

    this.toggleUserFileA = popmotionAction(({ complete }) => {
      this.visUserFileA.toggle();
      complete();
    });

    this.toggleUserFileB = popmotionAction(({ complete }) => {
      this.visUserFileB.toggle();
github lennerd / git-for-beginners / src / models / chapters / versioningInATeamChapter.js View on Github external
this.visSecondFile = new SimpleFileVisualisation();

    this.switchUser = popmotionAction(
      action(({ complete }) => {
        if (!this.loopNonlinear) {
          const otherUser = this.otherUser;
          this.otherUser = this.currentUser;
          this.currentUser = otherUser;
          this.currentUser.row = 0;
        }

        complete();
      }),
    );

    this.downloadToCurrentUser = popmotionAction(
      action(({ complete }) => {
        if (!this.loopNonlinear) {
          this.visFile.reset();
          this.currentUser.add(this.visFile);
        } else {
          this.visFile.reset();
          this.visSecondFile.reset();
          this.currentUser.add(this.visFile);
          this.otherUser.add(this.visSecondFile);
        }
        complete();
      }),
    );

    this.modify = popmotionAction(({ complete }) => {
      this.visFile.modify();
github Popmotion / popmotion / packages / popmotion-pose / dist / popmotion-pose.es.js View on Github external
var just = function (from) {
    return action(function (_a) {
        var update = _a.update,
            complete = _a.complete;
        update(from);
        complete();
    });
};
var underDampedSpring = function (_a) {
github lennerd / git-for-beginners / src / models / chapters / workingInATeamChapter.js View on Github external
this.uploadData = popmotionAction(({ complete }) => {
      this.visCloud.add(this.visFile);
      complete();
    });

    this.storeCloudFile = popmotionAction(({ complete }) => {
      this.visCloud.add(this.visCloudFile);
      complete();
    });

    this.storeUserBFile = popmotionAction(({ complete }) => {
      this.visUserB.add(this.visUserFileB);
      complete();
    });

    this.toggleUserFileA = popmotionAction(({ complete }) => {
      this.visUserFileA.toggle();
      complete();
    });

    this.toggleUserFileB = popmotionAction(({ complete }) => {
      this.visUserFileB.toggle();
      complete();
    });

    this.toggleCloudFile = popmotionAction(({ complete }) => {
      this.visCloudFile.toggle();
      complete();
    });

    this.actionQueue = actionQueue().start();
  },
github mattermost / mattermost-webapp / components / widgets / menu / menu_wrapper_animation.tsx View on Github external
private onEntering = (node: HTMLElement, isAppearing: boolean) => {
        const nodeStyler = styler(node);
        chain(
            action(({update, complete}) => {
                update({display: 'block'});
                complete();
            }),
            tween({from: {opacity: 0}, to: {opacity: 1}, duration: ANIMATION_DURATION}),
        ).start(nodeStyler.set);
    }
github lennerd / git-for-beginners / src / models / chapters / versioningInATeamChapter.js View on Github external
if (this.loopNonlinear) {
        this.visSecondFile.modify();
      }
      complete();
    });

    this.uploadToVersionDatabase = popmotionAction(({ complete }) => {
      this.visVersionDatabase.add(this.visFile);

      if (this.loopNonlinear) {
        this.visVersionDatabase.add(this.visSecondFile);
      }
      complete();
    });

    this.toggleCurrentFile = popmotionAction(({ complete }) => {
      this.currentUser.find(object => object.isFile).toggle();

      if (this.loopNonlinear) {
        this.otherUser.find(object => object.isFile).toggle();
      }

      complete();
    });

    this.versions = [];
    this.versionsCounter = 0;

    this.createVersion = popmotionAction(({ complete }) => {
      const version = this.visFile.copy();
      this.versions
        .splice(6)
github lennerd / git-for-beginners / src / models / chapters / workingInATeamChapter.js View on Github external
this.storeUserBFile = popmotionAction(({ complete }) => {
      this.visUserB.add(this.visUserFileB);
      complete();
    });

    this.toggleUserFileA = popmotionAction(({ complete }) => {
      this.visUserFileA.toggle();
      complete();
    });

    this.toggleUserFileB = popmotionAction(({ complete }) => {
      this.visUserFileB.toggle();
      complete();
    });

    this.toggleCloudFile = popmotionAction(({ complete }) => {
      this.visCloudFile.toggle();
      complete();
    });

    this.actionQueue = actionQueue().start();
  },
  [readOn]() {