Skip to content

Instantly share code, notes, and snippets.

@dimensi
Created September 20, 2017 09:51
Show Gist options
  • Save dimensi/e1a09fda9c1f16ddb29e5ca2d8ab03cb to your computer and use it in GitHub Desktop.
Save dimensi/e1a09fda9c1f16ddb29e5ca2d8ab03cb to your computer and use it in GitHub Desktop.
const createRequestFunc = (ctx, next) => axios(ctx.options)
.then(response => {
ctx.response = response
next()
})
if (record.options instanceof Array) {
record.options = merge.all(record.options)
}
if (record.meta instanceof Array) {
record.meta = merge.all(record.meta)
}
record.hooks.push(createRequestFunc)
const fn = compose(record.hooks)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment