Skip to content
This repository has been archived by the owner on Dec 11, 2018. It is now read-only.

Commit

Permalink
Document action.listenOnce.
Browse files Browse the repository at this point in the history
  • Loading branch information
pluma committed Dec 17, 2014
1 parent 8d54d99 commit 452323a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ If `spec` is an object, its properties will be copied to the new action, overwri

Invokes the action's listeners with the given `data`.

## action.listenOnce(fn, [ctx]):Function

Adds a given function to the action's listeners. If `ctx` is provided, the function will be invoked using it as its `this` context. The function will only be invoked once and is then automatically removed from the action's listeners.

Returns a function that will remove the listener from the action.

## action.listen(fn, [ctx]):Function

Adds a given function to the action's listeners. If `ctx` is provided, the function will be invoked using it as its `this` context.
Expand Down

0 comments on commit 452323a

Please sign in to comment.