Floodplains
A small event library.
Includes emit
and on
.
Demo
Install
npm install floodplains
How to Use
;const floodplains = ; floodplains; floodplains; floodplains; floodplains; floodplains;floodplains;floodplains;
How it Works
emit
floodplains;
An emitted event requires a name (e.g. "some-event"
) and a value (e.g. "hello, world!"
). The name must be a string
and the value can be anything.
on
floodplains;
The on
method actively listens for an event with a particular name (e.g. "some-event"
) and calls its callback whenever an event with that name is emitted.
Special "*"
event name will listen to all events.
License
MIT