protoscop

0.0.0 • Public • Published

proto-context NPM version Build Status Dependency Status Coveralls Status

Manage context with ease

Usage

var Context = require('proto-context');
var ctx = {};
 
ctx.value = 'first version';  // console.log(ctx.value) -> 'first version'
ctx = Context.snapshot(ctx);
ctx.value = 'second version'; // console.log(ctx.value) -> 'second version'
ctx = Context.restore(ctx);
console.log(ctx.value); // -> 'first version' 

API

Context.snapshot(ctx)

Creates new Object and add it to ctx prototype.

Context.restore(ctx)

Removes created Object from prototype chain of ctx.

Package Sidebar

Install

npm i protoscop

Weekly Downloads

0

Version

0.0.0

License

MIT

Last publish

Collaborators

  • floatdrop