0.0.9 • Published 8 years ago

pigeonjs v0.0.9

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

npm version Build Status Dependency Status devDependency Status MIT License

#Pigeon.js The idea of pigeon.js is to have a light and fast event-bus service. Moreover, to be able to remove your subscriber.

#Installation Install via NPM

npm install pigeonjs

and include the library into your application

<script src="https://github.com/w3tecch/pigeon.js/blob/master/dist/pigeon.min.js"></script>

#Usage

// Register a new channel
pigeon.channel('my-channel');

// Verify if my channel was created
pigeon.has('my-channel'); // returns a boolean

// Get a list of all subscribers of my channel
pigeon.channel('my-channel').subscribers;

// Get a list of all subscribers of my channel
pigeon.channel('my-channel').subscribe('item:updated', () => {
  // Callback function
});

// Removes my subscriber
let disposer = pigeon.channel('my-channel').subscribe('item:updated', () => {...});
disposer();

// Publish an event
pigeon.channel('my-channel').publish('item:updated', data);

// Create a new channel
let channel = pigeon.channel();

#License

MIT

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago

0.0.0

8 years ago