gsklee / ngStorage

localStorage and sessionStorage done right for AngularJS.
MIT License
2.33k stars 461 forks source link

Add $ngStorageChanged event after apply with changes #239

Open schmuli opened 8 years ago

schmuli commented 8 years ago

If we detect changes during the apply phase, we broadcast a $ngStorageChanged event on the $rootScope.

Additionally, since we also detect any changes to the underlying storage and apply those in the same manner, this event will be broadcast when the change might have come from a different tab.

Fixes #214

schmuli commented 8 years ago

Sorry about the formatting in the test, my VI isn't setup correctly for JS.

Also, currently I only implemented one event which will be fired for both storage services, local and session. It should be trivial to add an indicator as part of the event data from which service the event was broadcast.

dr3am3r commented 8 years ago

any update on this?

egilkh commented 8 years ago

Seems like a good addition. Will merge.

schmuli commented 8 years ago

@egilkh Any chance of getting this merged any time soon?

Thanks.