node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

backbone.event.one

Backbone.event.one

Add one method to Backbone.Events

Install

<script src="../lib/jquery-1.8.2.min.js" type="text/javascript"></script>
<script src="../lib/underscore-min.js" type="text/javascript"></script>
<script src="../lib/backbone-min.js" type="text/javascript"></script>
<script src="../lib/backbone.event.one.js" type="text/javascript"></script>

Usage

eventSpy = sinon.spy()
 
obj = _.extend {}Backbone.Events
obj.one "test"eventSpycontext->
  _this.filterSpy.apply thisarguments
  _this.filterReturnValue
 
obj.trigger "test"
obj.trigger "test"
eventSpy.calledOnce.should.be.true