readywhen

create deferred methods based on the ready state of the parent object

npm install readywhen
4 downloads in the last month

Note: this is part of an experiment with a pattern of organizing models and controller in browserify applications

ReadyWhen

npm install readywhen

var readyWhen = require('readywhen')
var whenReady = readyWhen(function(ready){
  setTimeout(function(){
      ready()
    }, 500)
  })
})

function User(){ ... }

User.prototype.save = whenReady(function(){
  ...
})
npm loves you