@paychex/adapter-xhr

2.1.9 • Public • Published

@paychex/adapter-xhr

A data adapter that uses the XMLHttpRequest object to convert a Request into a Response. Can be passed to the @paychex/core createDataLayer factory method to enable data operations on NodeJS.

Installation

npm install @paychex/adapter-xhr

Importing

esm

import { xhr } from '@paychex/adapter-xhr';

cjs

const { xhr } = require('@paychex/adapter-xhr');

amd

define(['@paychex/adapter-xhr'], function({ xhr }) { ... });
require(['@paychex/adapter-xhr'], function({ xhr }) { ... });

iife

const { xhr } = window['@paychex/adapter-xhr'];

Usage

import { data } from '@paychex/core';
import { xhr } from '@paychex/adapter-xhr';

const proxy = data.createProxy();
const { createRequest, fetch, setAdapter } = data.createDataLayer(proxy, xhr);

Package Sidebar

Install

npm i @paychex/adapter-xhr

Weekly Downloads

0

Version

2.1.9

License

Apache-2.0

Unpacked Size

1.39 MB

Total Files

40

Last publish

Collaborators

  • paychex-ssmithrand
  • dbarnes1
  • best442
  • dhergert-payx