model-storage
v1.0.0
Published
A browser library to load, save, init, and listen to events from the localStorage
Downloads
2
Maintainers
Readme
model-storage
model-storage is a browser-side javascript library to store and load objects in the localStorage, and listen to events.
Usage
var name = modelStorage.get("name");
modelStorage.set("message", "Hello World !");
modelStorage.has("unknown"); //false
var a = modelStorage.def("message", "init"); //a = "Hello World !"
var b = modelStorage.def("unknown", "init"); //b = "init";
modelStorage.has("unknown"); //true
modelStorage.onChange("key", function(value) {
});