@c4/use-async
<style>{`.sbdocs .markdown-only { display: none !important; }`}</style>GitHub Repository: https://github.com/bolasblack/react-components/tree/develop/packages/useAsync
For better reading experience, please visit{' '} Storybook .
import { Canvas, Meta } from '@storybook/addon-docs/blocks' import * as useAsyncStories from './src/useAsync.stories' import * as useAsyncFnFactoryStories from './src/useAsyncFnFactory.stories'
Usage
useAsync
A hook to load data/do asynchronous operations.
Will call function once component mounted, once deps changed:
- will re-call function;
- will re-generate
reRunfunction.
useAsyncFnFactory
A hook to load data/do asynchronous operations.
Will not call function automatically, once deps changed:
- will not re-call function;
- will call
fnFactoryto try re-generate async fn.