animitter icon indicating copy to clipboard operation
animitter copied to clipboard

complete() should mark instance as completed prior to stop

Open hapticdata opened this issue 6 years ago • 0 comments

Right now a call to instance.isCompleted() inside of a 'stop' handler would return false if invoked through instance.complete(). Should be marked as completed prior to event dispatch

const loop = new Animitter();
// will log out false
loop.on('stop', () => console.log(loop.isCompleted()));

loop.start();
// ...
loop.complete();

https://github.com/hapticdata/animitter/blob/master/index.js#L132-L137

user should be able to detect the loop was stopped from being completed from within a stop handler

hapticdata avatar Nov 05 '19 04:11 hapticdata