Custom copy+equality functions
Firstly, thanks for maintaining this module - it is really helpful. I've noticed for large objects in a single key, the performance of angular.copy is not great, meaning that ngstorage was identified as a bottleneck in our app due to the frequency at which this is done. After testing a few approaches we found that using angular.fromjson(angular.tojson(obj)) to copy objects within ngstorage to be about 3 times faster for our use case. It would be great if ngstorage could use local overridable functions for both copy and object equality operations in each place they are needed, perhaps defaulting to current implementations - similar to the de/serializer functions. This would also mean people can plugin things like lodash eq+clonedeep. If this is not clear I can send a PR when I get a chance.
Hey,
Thanks for the comment! Yes this should be easily doable as we already implement the same for serialization/deserialization. And it does make sense.
I'll look into it, if you beat me to it with a PR that is awesome as well :)
#177 here you go.
I'm also having performance problems with large objects in a single key.
The best example of this is having a text field with ng-model binded to localstorage variable. When you type on the text field, its lagging a lot. Do you have any ideas how to fix this or should I design the app differently?
For the lagginess, just set debounce in model options.