@enea-entertainment/runners
v1.0.1
Published
Santa's little helper
Downloads
3
Readme
Runners
Santa's little helper
Dependency: @enea-entertainment/runner
Installation
npm install --save-dev @enea-entertainment/runners
Usage example
import { createRunners, destroyRunners } from '@enea-entertainment/runners';
// will create runners object with remove and update Runner(s)
// notice number 2 after '|' - it means update runner has 2 arguments
this.runners = createRunners({
remove: 'onRemove',
update: 'onUpdate|2'
});
// dispatch
this.runners.remove.dispatch();
this.runners.update.dispatch(x, y);
// will detach all listeners from update and remove runners
destroyRunners(this.runners);
License
MIT, see LICENSE for details.