@lou.codes/notify is a tiny functional curried library to setup a simple
pub/sub system. It only has 3 functions:
broadcast. This last
is just bundling the other two and linking them to the same state.
This one started as a work requirement. Looking for a pub/sub library I found a bunch, but they were either an “overkill”, filled with unwanted features, or too old, or to “class based”. So I decided to make my own.
I built this library using TypeScript, with configurations from my shared configs. I made it ESM only as soon as Node started supporting ESM modules, and I made it tree-shakeable by using named exports.
It took longer to think how I wanted the API to look like, than actually making
it a reality. I started with
broadcast came later when I
figure out how I wanted to make it as functional as possible.
I’ve used this at work in private projects only, so no public usages yet, but as any other of my libraries, you can play with it in your browser terminal by going to the reference.