Simple factory implementation for js-signals.
A small factory implementation for js-signals.
This is a simple wrapper to make it even easier to use js-signals.
As expected, you will need to have
signals available in your application before using this script.
The signals factory reduces your signal management to a single point where you can request and retrieve all your signals. Using a signal is as simple as:
var completed = SignalFactorygetSignal;completedaddconsole.log'it is completed!';;
// First register a callback function to your signalSignalFactorygetSignal'completed'addconsole.log'it is completed!';;SignalFactorygetSignal'completed'dispatch;// it is completed!// Remove reference by nameSignalFactoryremoveSignal'completed';
var all = SignalFactoryall;
SignalFactoryclear;// All used signals are disposed and gone!
Released under the MIT License.