1.0.0 • Published 2 years ago
create-emit v1.0.0
create-emit
Introduction
Tiny 20 lines of functional event emitter/pubsub.
Comparing to other emitters, create-emit
cares more about type safe.
Installation
npm install --save create-emit
# or
yarn add create-emit
Usage
// create event with `string` type of payload
const sayHi = createEmit<string>()
// you can watch for the event to happen
const unsubscribe = sayHi.watch(console.log)
// fire the event with payload
sayHi('Peter') // Peter
sayHi('Drew') // Drew
1.0.0
2 years ago
0.0.0-development
2 years ago