Created
July 11, 2014 06:22
-
-
Save imyelo/3b0c32f835445ef75f81 to your computer and use it in GitHub Desktop.
Lockable.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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