edDimensi
9/20/2017 - 9:51 AM

test.js

  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)