craigspaeth/backbone-plus — Issue #5: Provide find methods
Author: craigspaeth
Created: 2011-12-10 21:32:40+00:00
State: open

I'd like to refactor this into a simple static method "find" for Backbone.Model & Backbone.Collection which will create a new Model, run fetch on it, and store it in an id: Model hash. So that next time App.Models.Artwork.find 'foo' is called it will pull it out of the hash & call fetch again. Eliminating the boilerplate complexity of the Repository.

Later I'll tackle the problem of client side caching by writing a small jQuery plugin or Backbone.sync plugin that'll cache the results of our API in local storage. (I'll be sure to throw a _.defer in there to make sure there's no async pitfalls)