Gets the number of keys in the offline store (i.e. its “length”).
USE WITH CAUTION: Removes every key from the database, returning it to a blank slate.
Gets an item from the storage library and supplies the result to a callback. If the key does not exist, getItem() will return null.
Even if undefined is saved, null will be returned by getItem(). This is due to a limitation in localStorage, and for compatibility reasons localForage cannot store the value undefined.
Warehouse.get('key').subscribe( (item) => { // do something with item }, (error) => { // handle the error } );
Get the name of a key based on its ID.
This method is inherited from the localStorage API, but is acknowledged to be kinda weird.
Get the list of all keys in the datastore.
Removes the value of a key from the offline store.
Saves data to the offline store. You can store the following types of JavaScript objects:
When using localStorage and WebSQL backends, binary data will be serialized before being saved (and retrieved). This serialization will incur a size increase when binary data is saved.
Warehouse.set('key', value).subscribe( (item) => { // do something with newly saved item }, (error) => { // handle the error } );
Generated using TypeDoc
The primary storage service. This is a wrapper around localForage. The endpoints provided by localForage are converted to observables.
Warehouse