winjsrocks-plugin-storage
v0.6.7
Published
WinJS-based MVVM architecture for cross-platform apps
Downloads
3
Maintainers
Readme
winjsrocks-plugin-storage
Contains storage related plugnis for the WinJSRocks MVVM Framework for WinJS apps.
This plugin extends the CoreLocalStorageProvider
in WinJSRocks
and adheres to the same API standard
Activation
To activate, import the plugin project from npm:
npm install winjsrocks-plugin-storage
Then, register in the WinJSRocks.Application.Instance.configure
options within the plugins
array:
var WinJSRocks = require('winjsrocks');
var WinJSRocksPluginStorage = require('winjsrocks-plugin-storage');
var app = new WinJSRocks.Application();
app.configure({
plugins:[
WinJSRocksPluginStorage // Provide the Class Definition of the Plugin
]
},
function(err){
});
Switching Storage Provider
By default, the indexedDB storage provider is configured. To change this option, set the provider strategy in the app.configure call:
...
app.configure({
plugins:[
WinJSRocksPluginStorage // Provide the Class Definition of the Plugin
],
storage: {
provider: "indexeddb"
}
},
function(err){
});
TBD: Only indexedDB is implemented but others can be added by submitting a request at https://github.com/DeepElement/winjsrocks/issues