Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

approvers/promisub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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();
}