1.0.7 • Published 6 years ago

inbetween-time v1.0.7

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Inbetween-time.js

Iteration tool Similar to Unity coruotine

Coming

  • await/waitforSeconds/pause -- pause iterations for a certain amount of time

Usage

https://cdn.rawgit.com/gilbertfrausto/inbetween-time/6b439ace/inbetween-time.js

Fiddle

https://jsfiddle.net/e95jh54t/

Repo

https://github.com/gilbertfrausto/inbetween-time

Examples

Inbetween time constructor and instance

constructor t_t({}) takes and Object with these options
OptionDescription
timertimer Time in ms between each Iteration.
countMax number of iterations.
methodMethod to be called during each iteration
Inbetween time Instance
MethodsDescription
iteratorwill call the method property passed into the constructor @return {void}.
waittake one argument and this is the amount of time the iterator will be stopped in milliseconds @return {void}
getCountget the count of iteration set to happen @return {number}
setCountchange the amount of iterations set to happen @return {void}
getInterationsgetInterations get the iterations number @return {number}
let myInstance = t_t({
    timer: 1000,
    count: 5,
    method: () => {
        console.log(`
            Will fire ${myInstance.getCount()} times!,
            Iteration count ${myInstance.getInterations() + 1}
        `);
    }
});

myInstance.iterator(); // Start iterator
myInstance.wait(2000);// Pause Iteration
1.0.7

6 years ago

1.0.6

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago