The in-memory store is offered as a fallback for browsers that do not support any of the other supported stores (e.g. WebSQL or Gears). In principal, it only keeps data in memory, which means that navigating away from the page (including a reload or tab close) will result in the loss of all data.
A way around this is using the persistence.saveToLocalStorage and
persistence.loadFromLocalStorage functions that can save the entire
database to the localStorage, which
is persisted indefinitely (similar to WebSQL).
If you're going to use the in-memory store, you can configure it as follows:
persistence.store.memory.config(persistence);
Then, if desired, current data can be loaded from the localStorage using:
persistence.loadFromLocalStorage(function() {
alert("All data loaded!");
});
And saved using:
persistence.saveToLocalStorage(function() {
alert("All data saved!");
});
Drawbacks of the in-memory store:
localStorage.