14. models
or
emitters?
What if models and collections are not enough?
https://github.com/component/emitter
var
Emitter
=
require('emitter');
var
UserModel
=
new
Emitter({}
data:
{},
update:
function(){
//some
async
update
this.data
=
newData;
this.emit('change');
//-‐-‐-‐
}
);
UserModel.on('change',
/*update
component*/);
//You
can
use
mixin
to
do
that
automatically
15. be Lazy with
factory
• get bunch of id’s
• get empty model’s from factory by these id’s
• pass them to component
• PROFIT!