-
-
Save myndzi/b6a3c9e71b5047ec5db2 to your computer and use it in GitHub Desktop.
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
function SidewaysCallback() { | |
var cb = null; | |
return { | |
listen: function (_cb) { | |
cb = _cb; | |
return function () { cb = null; } | |
}, | |
trigger: function () { | |
if (cb === null) { return; } | |
cb.apply(null, arguments); | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment