@local-logic/channel
v1.5.2
Published
This module defines a 'Channel', built upon the CustomEvent API. This abstraction provides a simple, Promise-based way for managing async events.
Downloads
2,194
Keywords
Readme
Channel
This module defines a 'Channel', built upon the CustomEvent API. This abstraction provides a simple, Promise-based way for managing async events.
A Channel assumes two nodes: a Leader and a Follower. The Leader is instantiated first, and its 'connection' Promise will resolve only when the Follower has suscessfully connected.
When a connection is established, events can be freely sent to and from each Node, thereby creating a Channel!