architecture Data REST API LocalStorage Google Spreadsheet Adapter Serializer Store “Talks” protocol Extracts raw data to Models Persists models Models
promises ▶ “eventual value returned from completion of operation” function callApi(id) { var promise = longRunningOperation(id); return promise; } //.... callApi(2).then(function(result) { // do sth with resolved result }, function(err) { // do sth with rejection });
querying and saving ▶ store.find[All,Query](‘model-name’[, id]); ▶ model_object.save(); ▶ both finders and save return promises for developer sanity (formerly a state chart with actions on edges) ▶ Em.RSVP.all([promise1, promise2]).then ...
young now, but ▶ provides clean separation of concerns ▶ developing client app without backend ▶ testing adapter code without rest of the app ▶ … ▶ “best practices” for api modelling ▶ integrates greatly with Ember if you use it Conclusion