📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

defektive-data-store

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

defektive-data-store

A simple data store

1.0.1
latest
Source
npm
Version published
Maintainers
1
Created
Source

defektive-data-store

Super simple data store. Uses wolfy87-eventemitter for event delegation.

Installation

npm install --save defektive-data-store

Usage

var DataStore = require('defektive-data-store'),
    myStore = new DataStore({
      color: "red",
      status: "not-borked"
    });
    
myStore.addListener('changed:color', function (event){
  console.log("color changed", event)
});

myStore.attr('color', 'blue');

Extending

var DataStore = require('defektive-data-store');

function Session(){
  DataStore.apply(this, arguments)  
}

Session.prototype = Object.create(DataStore.prototype);

Session.prototype.isLoggedIn = function () {
  return this.attr('loggedIn')
}

Keywords

datastore

FAQs

Package last updated on 09 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts