mirror of
https://github.com/GuerillaStudio/souvenir.git
synced 2025-02-01 12:49:39 +00:00
feat(gif preview): add utils functions
This commit is contained in:
parent
c361e6b8ac
commit
da154ef249
1 changed files with 14 additions and 0 deletions
|
@ -1,3 +1,17 @@
|
|||
export function delay(duration) {
|
||||
return new Promise((resolve, _) => {
|
||||
setTimeout(() => {
|
||||
resolve()
|
||||
}, duration)
|
||||
})
|
||||
}
|
||||
|
||||
export function* cycle(xs) {
|
||||
while (true) {
|
||||
yield* xs
|
||||
}
|
||||
}
|
||||
|
||||
export function calcProgress (from, to, value) {
|
||||
return from + ((to - from) * value)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue