0.0.2 • Published 7 years ago
rauricoste-event-stream-sync v0.0.2
Summary
It is a simple object for to publish messages to listeners. Messages are transmitted synchronously.
Exemple
const EventStream = require("rauricoste-event-stream-sync")
const stream = new EventStream()EventStream class
subscribe(fct: Function): add thefctas a listener of published messages.publish(message: Any): execute all listeners withmessageas its argument. Execution is synchronous and sequential.subEventStream(key: String): create anEventStreamobject that listens only on messages that are objects and have a value associated tokeykey and publishing only this value. Publishing on a sub EventStream does not publish on the parent EventStream.