sails-store
v1.0.3
Published
Storage resources with socket.io for sailsjs, useful for this module sails-react-store
Downloads
505
Readme
sails-store
Storage resources with socket.io for sailsjs
Installation
$ npm install sails-store
Usage
var StorSails = require('sails-store');
sItem = StorSails.StoreItem({
identity: "user",
id: 2
});
sItem.get()
sItem.on('updated', function(data){
console.log(data);
});
sItem.modify({})
///
sCollection = StorSails.StoreItem({
identity: "user"
});
sCollection.get()
sCollection.on('created', function(data){
console.log(data);
});
sCollection.add({});
sCollection.on('destroyed', function(data){
console.log(data);
});
sCollection.remove({});
License
MIT © 2015 contributors