Skip to content

Instantly share code, notes, and snippets.

@imyelo
Created July 11, 2014 06:22
Show Gist options
  • Select an option

  • Save imyelo/3b0c32f835445ef75f81 to your computer and use it in GitHub Desktop.

Select an option

Save imyelo/3b0c32f835445ef75f81 to your computer and use it in GitHub Desktop.
Lockable.js
var Lockable = function () {
var exports = {};
var _locks = {};
exports.lock = function (name) {
_locks[name] = true;
};
exports.unlock = function (name) {
_locks[name] = false;
};
exports.isLocking = function (name) {
return _locks[name] === true;
};
return exports;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment