Skip to content

Loop mode support "while" argument #18

@sasha240100

Description

@sasha240100

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)`;
});

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions