jshawl / active-storage

An ActiveRecord like interface for querying localStorage

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Active Storage Build status indicator

Usage

<script src='active-storage.js'></script>
<script>
  var Post = Object.create( new ActiveStorage("Post") );
</script>

Link to the ActiveStorage Library and create a new model.

You now have access to your favorite ActiveRecord methods, powered by localStorage!

.new

var p = Post.new({name: "Jesse"});

.create

var p = Post.create({name: "Jesse"});

#save

p.save();

.find

Post.find( 1 );

.findBy

Post.findBy( {name: "Jesse"} );

.where

Post.where( {name: "Jesse"} );

.all

Post.all();

#destroy

p.destroy();

.destroyAll

Post.destroyAll();

About

An ActiveRecord like interface for querying localStorage

License:MIT License


Languages

Language:JavaScript 75.2%Language:HTML 24.8%