lundi 23 mars 2015

What is the equivalent of ArrayProxy for a single project?

I have a simple find that looks up an object from a map by id. If that object does not exist I return null like so



findById: function(id) {
var identityMap = this.get("identityMap");
return identityMap[id] || null;
}


Ideally if that object "suddently shows up" I'd like to update the result (similar to how ArrayProxy works for collections that get items added/etc)


Is this something you can easily do w/ ember's computed property primitives? And does this still have support for a "null" or empty like construct?





Aucun commentaire:

Enregistrer un commentaire