Ionic2 Storage data persistence


#1

hello, I am considering utilizing the ionic 2 storage facility for data persistence.

normally, we need a mechanism to check if a data is existing before initializing the data in persistant storage; something similar to this:

constructor(platform: Platform,  private storage: Storage) {
    platform.ready().then(() => {
       ...
      //make sure the key does not exist in persistence
      if(!this.storage.exist('key')){
       this.storage.set('key', 'initial value');
       };
      ...
    };

without this, we just kept overwriting previous settings.
I read the docs about Storage, and did not find anything relevant…

anyone has any idea?

thanks