0.3.4 • Published 5 years ago

@repeaterjs/pubsub v0.3.4

Weekly downloads
11
License
MIT
Repository
github
Last release
5 years ago

@repeater/pubusb

This package is experimental!

A generic pubsub class, implemented with repeaters

For more information, visit repeater.js.org.

interface PubSub<T> {
  publish(topic: string, value: T): Promise<void> | void;
  unpublish(topic: string, reason?: any): Promise<void> | void;
  subscribe(topic: string, buffer?: RepeaterBuffer<T>): AsyncIterableIterator<T>;
  close(reason?: any): Promise<void> | void;
}

class InMemoryPubSub<T> implements PubSub<T> {
  publish(topic: string, value: T): void;
  unpublish(topic: string, reason?: any): void;
  subscribe(topic: string, buffer?: RepeaterBuffer<T>): Repeater<T>;
  close(reason?: any): void;
}
0.3.4

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.1

5 years ago