Skip to content

jedtrow/simple-persistent-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-persistent-data

A simple way to handing persistent data in a Cordova app.

Basically simplePersistentData allows you to have one JSON object that gets saved to persistent on device storage. This is incredibly usefull for simple apps that only need to save small amounts of data such as settings.

Usage

Simply include the file simplePersistentData.min.js (includes fileWrapper.js).

Then after onDeviceReady you would:

var data = {};

load_data(
    function(){
        // data successfully loaded
        // do whatever
    },
    function(){
        // an error occured
    }
);

Then whenever you want to save data to 'disk'

save_data();

To mimic behaviour in the browser simply enter the following in your console.

localStorage.DEVMODE = true;

About

A simple way to handle persistent data in a Cordova app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published