observ-once
v1.0.0
Published
Listen to a single observable value change and immediate unlisten
Downloads
5
Readme
observ-once
Listen to a single observable value change and immediate unlisten
Install
$ npm install --save observ-once
Usage
var once = require('observ-once')
var Observ = require('observ')
var observable = Observ()
once(observable, console.log)
observable.set(1)
observable.set(2)
observable.set(3)
//=> only prints 1
API
once(observable, listener)
-> undefined
obserable
Required
Type: function
An observable value representation.
listener
Required
Type: function
A listener to call the first time the value changes.
License
MIT © Ben Drucker