Skip to content

Instantly share code, notes, and snippets.

@scrapcupcake
Created April 24, 2018 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scrapcupcake/9ebb78aaa279e5897811309b59b9ebe6 to your computer and use it in GitHub Desktop.
Save scrapcupcake/9ebb78aaa279e5897811309b59b9ebe6 to your computer and use it in GitHub Desktop.
duration = (ms, scheduler = Scheduler.animationFrame) => {
return msElapsed()
.map(ems => ems / ms)
.takeWhile(t => t <= 1)
.finally(() => 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment