1.1.0 • Published 6 years ago

tiny-pubsub v1.1.0

Weekly downloads
95
License
MIT
Repository
github
Last release
6 years ago

tiny-pubsub

tiny-pubsub is a super simple event management package written in javascript with no dependencies.

You don't need a framework

Right now tiny-pubsub is 854 bytes.

It handles most of the UI interactions for my game bulletz.io.

I wholeheartedly believe my game is more performant and simple due to the lack of framework.

Installation

npm install --save tiny-pubsub

Usage

The api only has three functions. publish, subscribe, and unsubscribe.

const {subscribe, publish, unsubscribe} = require('tiny-pubsub')

let logJoin = (name) => console.log(`${name} has joined the room!`);
subscribe("chatroom-join", logJoin)
publish("chatroom-join", "Luke")
// > Luke has joined the room!
unsubscribe(logJoin)
publish("chatroom-join", "Luke")
// nothing will print

Contributing

Send pull requests.

Testing

npm install --dev
npm run test

License

MIT License.

1.1.0

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago