You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So web developers are used to localStorage. But we should be using Windows.Storage.ApplicationData. But of course that's an overwrought mess. WinningJS to the rescue!
Idea:
// Only localStorage examples shown, but the beauty is the same API in both cases.varlocalStorage=require("WinningJS").storage.local;varroamingStorage=require("WinningJS").storage.roaming;// Idea #1: match ES6 map/dict methods// Note: less powerful than ES6 map because you can't key by object localStorage.get("setting");localStorage.has("setting");localStorage.set("setting",arbitraryJsonableObject);localStorage.delete("setting");localStorage.empty();// not a member of ES6 map or dict. async.// Idea #2: match window.localStorage methods// Note: less powerful than localStorage because you can't use indexer syntax.localStorage.getItem("setting");localStorage.setItem("setting",arbitraryJsonableObject);// note: more powerful than window.localStoragelocalStorage.removeItem("setting");localStorage.clear();// async, unlike window.localStorage// window.localStorage has no `has` method.// http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.applicationdata.datachanged.aspxroamingStorage.on("sync",function(ev){});
Big missing piece:versioning!! Maybe instead of require("WinningJS").storage.local it should be require("WinningJS").storage.local.getVersion(1, upgradeHandler)?
The text was updated successfully, but these errors were encountered:
So web developers are used to
localStorage
. But we should be usingWindows.Storage.ApplicationData
. But of course that's an overwrought mess. WinningJS to the rescue!Idea:
Big missing piece: versioning!! Maybe instead of
require("WinningJS").storage.local
it should berequire("WinningJS").storage.local.getVersion(1, upgradeHandler)
?The text was updated successfully, but these errors were encountered: