icicle
v0.1.3
Published
Can freeze and unfreeze on any object. Tiny mutex.
Downloads
2,343
Readme
❄ Icicle
Tiny mutex.
$ npm install icicle
var icicle = require('icicle');
var a = {};
icicle.freeze(a, 'waitABit'); // true - lock is set
icicle.freeze(a, 'waitABit'); // false - lock is already set
icicle.isFrozen(a, 'waitABit'); // true
icicle.unfreeze(a, 'waitABit'); // true - lock is unset
icicle.unfreeze(a, 'waitABit'); // false - lock isn’t set
icicle.isFrozen(a, 'waitABit'); // false