1.1.0 • Published 5 years ago

tiny-pubsub v1.1.0

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

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago