4.0.1 • Published 5 years ago

postup v4.0.1

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

Postup

Multi channel message bus

Postup is a multi channel message bus written in TypeScript. It runs in the browser, or on the server using node.js.

Setup

yarn add postup

or

npm install --save postup

Usage

Before you start import the library

import Postup from 'postup'

Basic usage

// Setup a new bus with no buffer
const bus = new Postup()
const chan = bus.channel(['topic'])

// Data published can be anything
const context = { test: true }

// Setup a subscriber
const ubsubscribe = bus.subscribe((data, topic) => {
  console.log(data, topic) // { test: true } ["topic"]
})

// Publish some data
chan.publish(context)

// Cleanup
unsubsribe()

License

MIT

4.0.1

5 years ago

4.0.0

5 years ago

3.0.0

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago