Skip to main content
Deno 2 is finally here 🎉️
Learn more

promisub

The publish/subscription utility by Promise in Deno.

Usage

const p = new Promisub<number>();

// Publish events
p.publish(event1, event2, ...);

// Wait an event
await p.once();

// Listen events infinite
for await (const event of p) {
  // Handle event here
  // :
  // :

  // Stop to listen
  p.close();
}