Skip to content

Latest commit

 

History

History

useAsync

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

@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.