angular-local-storage
angular-local-storage copied to clipboard
Add support for Chrome Web Apps
Would it be possible to add support for Chrome Web Apps? So that the library can be used across different platforms, and if the code runs within a Chrome Web App, it would use chrome.storage.local and not window.localStorage.
I think it would. It's just another storage type.
@grevory You accepting PR's for this?
@richarddavenport feel free to open a PR. Any suggestion on how to tackle this?
@ealves-pt and @grevory, one thing I'm seeing (finally looking at this) is that localStorage and sessionStorage return values immediately, which makes things pretty easy to work with. However, when using chrome.storage they return a callback. I think that having callbacks are good, but I could see how it might break some things. I think that if the code was refactored slightly it would make things more extendable and open up the possibility to use other storage use cases down the road. Right now I think adding chrome.storage would add some bloat, but refactoring could keep the code to a manageable size.
Let me know if you guys are willing to look at some of the code.
I've written a number of Chrome extensions so I do have interest in this. On May 14, 2016 5:22 PM, "Richard Davenport" [email protected] wrote:
@ealves-pt https://github.com/ealves-pt and @grevory https://github.com/grevory, one thing I'm seeing (finally looking at this) is that localStorage and sessionStorage return values immediately, which makes things pretty easy to work with. However, when using chrome.storage they return a callback. I think that having callbacks are good, but I could see how it might break some things. I think that if the code was refactored slightly it would make things more extendable and open up the possibility to use other storage use cases down the road. Right now I think adding chrome.storage would add some bloat, but refactoring could keep the code to a manageable size.
Let me know if you guys are willing to look at some of the code.
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/grevory/angular-local-storage/issues/257#issuecomment-219247766
I've seen a couple of different suggestions for changing the api, but of course they may be breaking changes.
localStorageService.set(key, value, storageType));
and
localStorageService.setStorageType(storageType).set(key, value));
Both of these might be possible as optional and be implemented as non-breaking changes, but I'm not 100% sure.