Created
September 20, 2017 09:51
-
-
Save dimensi/e1a09fda9c1f16ddb29e5ca2d8ab03cb 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
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