xswr
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

English | 简体中文

xswr

A data fetching solution for React Hooks and Imperative Ajax request

npm version NPM downloads code style: prettier

Introduction

xswr is inspired by swr and documentation HTTP RFC 5861 mentioned in its readme file. In general, comparing with swr, xswr has following features

  1. Scenario, applicable for React Hooks and Promise-base Ajax request
  2. Isolated Configuration Context, fetcher is identified by key param and shared by items with same key, config is isolated from each other.
  3. Re-render control, In React Hooks, it is configurable to control whether re-render component or not caused by data change.
  4. Easy to use, In Promise-based Ajax chain request, retry and pooling could be performed automatically.

Installation

With npm

npm install xswr

With yarn

yarn add xswr

How does xswr works

basic mechanism

Usage

  1. useXS - React Hooks solution
  2. xs - Promise-based Ajax solution

Package Sidebar

Install

npm i xswr

Weekly Downloads

11

Version

1.1.0

License

ISC

Unpacked Size

471 kB

Total Files

59

Last publish

Collaborators

  • ryuyutyo