0.0.0 • Published 10 years ago
protoscop v0.0.0
proto-context
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.
0.0.0
10 years ago