get-set

0.1.0 • Public • Published

getSet

For small projects that don't necessitate a framework solution, I often want to reach into the backbone.js toolkit. getSet provides that minimal kit: events (on, trigger), get, and set.

Usage

npm install get-set
var GetSet = require('get-set');
 
//Define your constructor
var MyModel = function() {};
 
MyModel.prototpe = new GetSet();
 
//Now define the rest of your model...
MyModel.prototype...

API

.on(name, fn)
.trigger(name, arg1, arg2 /* , ... */)
.get(key)
.set(key,val);
//or
.set(object); //Object of key-val pairs

Readme

Keywords

none

Package Sidebar

Install

npm i get-set

Weekly Downloads

2

Version

0.1.0

License

BSD

Last publish

Collaborators

  • itsjoesullivan