English | 简体中文
xswr
A data fetching solution for React Hooks and Imperative Ajax request
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
- Scenario, applicable for React Hooks and Promise-base Ajax request
- Isolated Configuration Context, fetcher is identified by
key
param and shared by items with same key, config is isolated from each other. - Re-render control, In React Hooks, it is configurable to control whether re-render component or not caused by data change.
- 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