@jiwon.me/pubsub-ts
v0.1.0
Published
publisher-subscriber pattern implementation on typescript
Downloads
2
Maintainers
Readme
pubsub-ts
Usage
import { PubSub } from "./pubsub";
interface TOPICS {
'ADD': (a: number, b: number) => number;
'GET_USER_ID': (userName: string) => string;
}
const pubsub = new PubSub<TOPICS>();
pubsub.sub('ADD', (a: number, b: number) => (a+b));
pubsub.sub('MINUS', )