scryptmouse/Backbone.ChromeStorage — pull request #3 by nigggle (2013-05-24 18:03:17+00:00)
Title: Critical Bug fix for find + Support for conncurent access.

The first fix is for the find function. Currently it never works and the library will never successfully read when only a single model id is specified.

This is because the find function thinks the returned result from the storage.get function is a single string. However it is in fact an array with the model ID searched for as the key and the value containing the JSON of the model. So simply my change just uses the models id to get the actual result we want from the array and uses that.

My second change is so when a user has multiple pages open each accessing and updating the same local storage that when one page makes a change the other pages will update their local record string accordingly.

Currently if one page makes a change e.g. adds or deletes a record, another page will not see this happen. My change makes each page listen for changes in the local storage to the record string and if one occurs update their this.records variable allowing that page to now see the changes to the collection.