deloreanjs/delorean — pull request #45 by darcyadams (2014-11-03 19:53:45+00:00)
Title: Expand watchStores property to apply to state as well

In a larger app, it becomes inefficient to iterate over, and apply `state` from every store in your application, to every view with the `storeListener` mixin.
This fix will use the `watchStores` property instead (when defined). This means that at no point will all stores be iterated over when a component provides a `watchStores` property. It also means that stores with a `watchStores` property will not get any `state` from stores not listed (which should be fine, since if a component cares about a store's `state`, it will also want to watch for changes).
I also took this opportunity to optimize the `getStoreStates` method, which was doing some excessive checking and not taking advantage of local variables.