So, I'm trying to follow this https://developer.chrome.com/extensions/storage#property-local documentation, but value[category] isn't being updated by the set operation, anybody know what's going on here? g is a global object and g[category] increments to a click event.
//assume someNum has already been stored as a 0
var g = {someNum:0};
var category = "someNum";
g[category]++;
chrome.storage.local.set({category:g[category]}, function () {
console.log(g[category]); // 1
chrome.storage.local.get(category, function (value) {
console.log(value[category]); // 0
});
});