1.0.0 • Published 10 months ago

@c4/use-async v1.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
10 months ago

@c4/use-async

import { Canvas, Meta } from '@storybook/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 reRun function.

useAsyncFnFactory

A hook to load data/do asynchronous operations.

Will not call function automatically, once deps changed:

  • will not re-call function;
  • will call fnFactory to try re-generate async fn.