ftlabs/fruitmachine

Build in `modelFound` logic

wilsonpage opened this issue · 1 comments

Giving the dev the opportunity to switch out 'dead' models embedded in the server rendered view json, with 'live' synced models on the client.

FruitMachine.define({
  onModelFound: function(model, view) {
    //...swap it out
  }
});

or

FruitMachine.on('modelfound', function(model, view) {
  //...swap it out
});

This functionality should now be available via the fm.on('inflation', function(view, options){}); and view.on('inflation', ...); event hooks. Soon to land in v0.4.