Skip to content

A data adapter that uses the XMLHttpRequest object in web browsers to convert a Request into a Response.

License

Notifications You must be signed in to change notification settings

ghas-results/adapter-xhr

 
 

Repository files navigation

@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);

About

A data adapter that uses the XMLHttpRequest object in web browsers to convert a Request into a Response.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 84.4%
  • JavaScript 15.6%