Skip to content

Instantly share code, notes, and snippets.

View zhanbei's full-sized avatar
😇
Being Professional

Yu Zhanbei zhanbei

😇
Being Professional
View GitHub Profile
@zhanbei
zhanbei / use-fetcher.tsx
Created November 7, 2019 08:33
Simplified states react hook manager for the animations around the process of data fetching/loading.
'use strict';
import React from 'react';
// A state hook that supports 5 fetcher states:
//
// @see [Data Fetching/Loading Animations · Issue #2 · zhanbei/uzbei.com](https://github.com/zhanbei/uzbei.com/issues/2)
// ref [streamich/react-use: React Hooks - Github](https://github.com/streamich/react-use)
// ref [rehooks/awesome-react-hooks: Awesome React Hooks - Github](https://github.com/rehooks/awesome-react-hooks)
//