1.1.7 • Published 4 years ago

ty-pubsub v1.1.7

Weekly downloads
171
License
MIT
Repository
github
Last release
4 years ago

Import the module

import { PubSub } from 'ty-pubsub'

or

const { PubSub } = require('ty-pubsub')

Create an instance

const pubsub = new PubSub()

Subscribe to an event

const subscriberId = pubsub.subscribe('eventName', function() {...}, options)

interface PubSubOptions {
  collectPreviousEvents?: boolean;
}

Unsubscribe

pubsub.unsubscribe('eventName', subscriberId)

Publish an event

pubsub.publish('eventName', data)

1.1.7

4 years ago

1.1.6

4 years ago

1.1.1

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago