collect-methods
Collect a series of methods then run them. Kind of like an event emitter where everything is once.
Installation
npm install collect-methods
Usage
var Collector = ; var stop = ; moduleexports = start: start stop: stop restart: restart; { // init state object and stuff... ; ; ; return stop;} { ; ;}
API
CollectMethods()
-> collector
Create a new method collector instance.
collector(method)
-> removeListener
Add a new method to the collector. Returns a removeListener function. When executed, removeListener returns an array of the methods removed from the queue.
method
Required
Type: function
The handler to execute when the collector is run
collector()
Executes all of the methods in the queue and clears it. Subsequent calls will do nothing until new handlers are added.
Contributing
npm run test
License
MIT