Intro
This is a tiny factory fonction to create a really simple event emitter.
Get started
Find API documentation on chirashijs.github.io/chirashi-event-emitter.
Quick view
Installation
Using npm / yarn (recommended)
yarn add chirashi-event-emitter
or
npm i --save chirashi-event-emitter
Now you can import methods in your project:
const emitter = const off = emitter emitter// logs: foo, bar emitter// won't log anything
Standalone
You can download chirashi-event-emitter.js or chirashi-event-emitter.min.js and load it using a script tag. You can also use CDN version of those files from unpkg using the link https://unpkg.com/chirashi@latest/dist/chirashi-event-emitter.min.js. It'll create an instance of ChirashiEventEmitter on your window. Then use as following example
const emitter = const off = emitter emitter// logs: foo, bar emitter// won't log anything