Converts a Request into a Response by running the request through an appropriate Adapter.
Adapter not found.
Invalid request passed to fetch.
(if the Response.status is not 2xx)
import xhr from '@paychex/adapter-xhr';import tracker from '~/path/to/tracker';import proxy from '~/path/to/proxy';// NOTE: you will probably already have access to// a datalayer and not need to create one yourselfconst { fetch, createRequest } = data.createDataLayer(proxy, xhr);const request = createRequest({ base: 'my-app', path: '/live',});fetch(request) .then(response => { tracker.event('app is live', { status: response.status, message: response.statusText, moreInfo: response.data, }); }) .catch(tracker.error);
The Request to pass to an Adapter and convert into a Response.
A Promise resolved with response information for the request.
Converts a Request into a Response by running the request through an appropriate Adapter.
Adapter not found.
Invalid request passed to fetch.
(if the Response.status is not 2xx)