Skip to content

Instantly share code, notes, and snippets.

@vdeturckheim
Last active November 12, 2017 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vdeturckheim/6cfaeb8ab6238a7144d20b1623a0d0f7 to your computer and use it in GitHub Desktop.
Save vdeturckheim/6cfaeb8ab6238a7144d20b1623a0d0f7 to your computer and use it in GitHub Desktop.
const getContext = function (asyncId = AsyncHooks.executionAsyncId()) {
// this returns the context linked to a given asynchronous id, by default, current asynchronous id is used.
return context.get(asyncId);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment