Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Callback functions for each item of a sequence #6

Open
dbismut opened this issue May 12, 2020 · 0 comments
Open

Callback functions for each item of a sequence #6

dbismut opened this issue May 12, 2020 · 0 comments

Comments

@dbismut
Copy link

dbismut commented May 12, 2020

This lib looks really impressive!

I'm curious if there is a way to execute a callback / step for each item of a sequence. I've tried the following but it didn't work:

const o = { a: 1 }

Fat.animate(
  { obj: o },
  [
    {
      a: { from: 1, to: 0, duration: 2000 },
      callback: function () { // <-- this is what I'm interested in
        console.log('First animation finished')
      },
    },
    {
      a: { to: 1, duration: 2000 },
    },
  ],
  {
    callback: function () {
      console.log('All animations finished')
    },
  }
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant