retain-localstorage

Retain localStorage client-side plugin

Usage no npm install needed!

<script type="module">
  import retainLocalstorage from 'https://cdn.skypack.dev/retain-localstorage';
</script>

README

Retain-LocalStorage">

Retain localStorage plugin

Build Status

Example

To start saving the Retain data in the localStorage, simply inject the plugin into the Model.

var retain = require("retain");
var retainLocalStorage = require("retain-localstorage");

var Movies = retain();

Movies.use(retainLocalStorage, { name: "movies"});

Config

  • name: LocalStorage collection name.

Creating a plugin

Retain use Promises internally to transfer data between the plugins.

To create a plugin, it is necessary to implement each of the following Retain methods.

  • new
  • all
  • set
  • find
  • remove

Each of theses methods must return a promise.