1.3.0 • Published 2 years ago

@react-hookbox/after-loading-effect v1.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@react-hookbox/after-loading-effect

useAfterLoadingEffect

NPM Minzipped Bundle Size

Install

npm install --save @react-hookbox/after-loading-effect

or

yarn add @react-hookbox/after-loading-effect

Usage

useAfterLoadingEffect

Both for JavaScript and Typescript:

import { useAfterLoadingEffect } from '@react-hookbox/after-loading-effect';
// OR
// import useAfterLoadingEffect from '@react-hookbox/after-loading-effect';

// then
useAfterLoadingEffect(isLoading, () => {
  // this will work only when isLoading turned from true to false
  console.log('Loading ended! 🎉🎉🎉');
});

Params

useAfterLoadingEffect

  • isLoading: boolean. When this changes from true to false, then the callback fn will be called in effect-ive time.
  • fn: EffectCallback. the callback function to call after loading ends. The return value of this function will be provided to the effect hook.
  • useEffectHook = useEffect. (Optional) The hook to use for calling the callback function.

License

MIT © hakobpogh

1.3.0

2 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago