Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bolasblack/backbone.event.one
add `one` method to Backbone.Events
https://github.com/bolasblack/backbone.event.one
Last synced: 11 days ago
JSON representation
add `one` method to Backbone.Events
- Host: GitHub
- URL: https://github.com/bolasblack/backbone.event.one
- Owner: bolasblack
- Created: 2012-12-14T13:42:25.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-01-07T09:00:47.000Z (about 12 years ago)
- Last Synced: 2024-11-10T03:36:32.835Z (2 months ago)
- Language: JavaScript
- Size: 227 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Backbone.event.one
**Add `one` method to `Backbone.Events`**
## Install
```html
```
## Usage
```coffeescript
eventSpy = sinon.spy()
filterSpy = sinon.spy()obj = _.extend {}, Backbone.Events
obj.one "test", eventSpy, context, (returnValue) ->
filterSpy.apply this, arguments
returnValueobj.trigger "test", false
filterSpy.called.should.be.true
eventSpy.called.should.be.falseobj.trigger "test", true
filterSpy.calledTwice.should.be.true
eventSpy.calledOnce.should.be.true
```