UNPKG

ghunti-devour-client

Version:

A lightweight, framework agnostic, flexible JSON API client

12 lines (11 loc) 240 B
export default function (jsonApi, res = {}) { jsonApi.middleware.unshift({ name: 'mock-response', req: (payload) => { payload.req.adapter = function (resolve) { resolve(res) } return payload } }) }