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

Loop mode support "while" argument #18

Open
sasha240100 opened this issue Jul 30, 2018 · 0 comments
Open

Loop mode support "while" argument #18

sasha240100 opened this issue Jul 30, 2018 · 0 comments
Assignees

Comments

@sasha240100
Copy link
Owner

This issue is an addition to issue #9

Would be nice if .loop() would support aka "while" function instead of specific maxNumber.

Concept:

let isLoaded = false;

fetch('http://example.com/api').then(() => {
  // do some stuff
  isLoaded = true;
})

const tween = new Between(0, 360)
  .time(1500) // 1500ms
  .loop('repeat', () => !isLoaded); // repeat if not loaded

tween.on('update', v => {
  spinnerElement.style.transform = `rotate(${v}deg)`;
});
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

2 participants