1.1.7 • Published 6 years ago

ty-pubsub v1.1.7

Weekly downloads
171
License
MIT
Repository
github
Last release
6 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

6 years ago

1.1.6

6 years ago

1.1.1

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago