0.0.0 • Published 10 years ago

protoscop v0.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

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.