Skip to content

Instantly share code, notes, and snippets.

@selfup
Last active June 18, 2016 01:32
Show Gist options
  • Save selfup/f57c7bb1aed0b6e80dd8d6f47a8866b5 to your computer and use it in GitHub Desktop.
Save selfup/f57c7bb1aed0b6e80dd8d6f47a8866b5 to your computer and use it in GitHub Desktop.

Playground for Lspi

Open up the console and start playing around!

(F12) on Windows - (Cmd + Option + i) on Mac - (F12) on Linux.

Then click the console tab.

Try the following:

lspi.createRecord("testOne")
// Now that you have created a record try grabbing it

lspi.getRecord("testOne")
// This returns an empty object. Now we add a real object

lspi.updateRecord("testOne", {test: "Basic data for the 'testOne' record"})
// Now let's see what that really looks like

lspi.getRecord("testOne")
// Ok cool! You are using a high level API for the LocalStorage API. Think of this as an ORM!

lspi.deleteRecord("testOne")
// Now you don't have any more data. Feel free to use this in your projects!

Here is the repo:

Repo Link

Have fun!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment