4 ms·
Awesome to see you guys utilizing a few different technologies to their strengths and not going the "silver bullet" route. Regarding your "Update resource B wh
by taterbase 14y ago
Awesome to see you guys utilizing a few different technologies to their strengths and not going the "silver bullet" route.
Regarding your "Update resource B when A changes" situation you can use Backbone's callback hash
var self = this;
this.save(null, {
success: function(model, response){
self.trigger('updateResourceB', response);
},
error: function(model, response){
//Error handling
});
saving Resource A to fire an event that Resource B can listen to and perform a fetch to get back in sync.
- adrianpike 14y agoThat's actually what we're doing right now. Resource B doesn't always require an update though, and we'd like to be able to pass back to the client some better information on whether or not that needs to happen. Unfortunately, I haven't had a brilliant epiphany yet how to do that without adding some virtual attributes or something similar to the JSON representation of Resource A that gets passed back. Thanks for the kind words on our choice of a bunch of technologies - it's most appreciated. :)