Skip to content

Instantly share code, notes, and snippets.

@aaronshaf
Last active October 22, 2015 03:23
Show Gist options
  • Select an option

  • Save aaronshaf/b3d754de1e4bcad53da0 to your computer and use it in GitHub Desktop.

Select an option

Save aaronshaf/b3d754de1e4bcad53da0 to your computer and use it in GitHub Desktop.
router('/foo', async function(ctx) {
ctx.unsubscribe = await doStuff()
})
router('/foo', async function(ctx) {
ctx.unsubscribeMore = await doMoreStuff()
})
router.after('/foo', async function(ctx) {
await doMoreStuff(ctx)
})
router.exit('/foo', function(ctx) {
ctx.unsubscribe()
ctx.unsubscribeMore()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment