vigour-is

2.3.3 • Public • Published

vigour-is

Build Status js-standard-style npm version Coverage Status

.is api for observables (observes until a value fulfils conditions)

  // add a once listener
  obs.is('something', () => {
    console.log('fire!')
  })
 
  // fire!
  obs.set('something')
 
  // fire immediatly
  obs.is('something', (data, stamp, target) => {
    console.log('fire!')
  })
 
  // fire immmediatly, as a promise
  obs.is('something').then(() => {
    console.log('fire')
  })
 
  // fire immmediatly, as a promise
  obs.is('something').then((target, data, stamp) => {
    console.log('fire', target, data, stamp)
  })
 
  // use a compare function
  obs.is((val, data, stamp, target) => val === 'hello')
    .then((target, data, stamp) => {
      console.log('fire', target, data, stamp)
    })

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.3.3
    25
    • latest

Version History

Package Sidebar

Install

npm i vigour-is

Weekly Downloads

8

Version

2.3.3

License

ISC

Last publish

Collaborators

  • vigour-io