Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/laget-se/simple-pubsub
Simple PubSub eventing via proxied Backbone.Events.
https://github.com/laget-se/simple-pubsub
Last synced: 22 days ago
JSON representation
Simple PubSub eventing via proxied Backbone.Events.
- Host: GitHub
- URL: https://github.com/laget-se/simple-pubsub
- Owner: laget-se
- License: mit
- Created: 2021-06-11T11:15:13.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-07-31T04:58:32.000Z (over 1 year ago)
- Last Synced: 2024-03-27T01:18:42.001Z (9 months ago)
- Language: JavaScript
- Size: 17.6 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Simple PubSub
===============Simple PubSub eventing via proxied Backbone.Events. Best used with Browserify! https://github.com/substack/node-browserify.
Installation
------------- `npm install simple-pubsub`
API
---http://backbonejs.org/#Events
– `on`
– `off`
– `trigger`
– `once`
– `listenTo`
– `stopListening`
– `listenToOnce`Example
-------```
var PubSub = require('simple-pubsub')PubSub.on('event', function (params) {
console.log('Hi!', params.name)
})PubSub.trigger('event', {
name: 'Shostakovich'
})PubSub.off('event')
```Tests
------ `npm install -g grunt-cli`
- `npm install`
- `grunt test`Thanks
------- Backbone.js
- Underscore.js