senecajs / seneca-entity

Entity plugin for seneca
MIT License
13 stars 15 forks source link

Entity methods should chain and gate #8

Open mcdonnelldean opened 8 years ago

mcdonnelldean commented 8 years ago

Via, https://github.com/senecajs/seneca/issues/102

seneca
  .make$("foo")
  .load$( 1234 ) // no cb, so return a gated delegate
  .data$( {a:1} ) // update some fields; this waits for load to complete; 
                         // errors are logged, not thrown, case halt of chain; 
                         // likewise non-existence halts chain
  .save$() // saves