Simple frustration free libraries.
Events as a first class citizen.
npm install kiss-events --save
- Signal Event dispatching
// Create Signal
let message = new Signal();
// Setup one or more listeners
const listener = message.on(m => console.info(m));
// Or just listen once, no need to remove listener
message.once(m => console.info(m));
// Trigger an event
message.trigger("We have a problem");
// Stop listener
message.off(listener);
- Property Property change event dispatching
// Create Property
let name = new Property();
// Setup one or more listeners
const listener = name.on(name => console.log(name));
// Or just listen once, no need to remove listener
// Trigger a change
name.value = "Scott B"
// Stop listener
name.off(listener);