Last active
December 30, 2015 04:29
-
-
Save creationix/7776192 to your computer and use it in GitHub Desktop.
This file contains 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
// We can't console.log inside of the event handlers since that triggers a new | |
// event source. This is safe to call though, since it sets a global ignore flag. | |
var ignore = false; | |
function print(msg) { | |
ignore = true; | |
console.log(msg); | |
ignore = false; | |
} | |
process.addAsyncListener(function () { | |
if (ignore) return; | |
// ... | |
}, { | |
before: function (context, storage) { | |
if (ignore || !storage) return; | |
// ... | |
}, | |
after: function (context, storage) { | |
if (ignore || !storage) return; | |
// ... | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment