@react-hookbox/after-loading-effect
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

@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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.3.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.3.0
    0
  • 1.2.0
    1
  • 1.1.0
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i @react-hookbox/after-loading-effect

Weekly Downloads

1

Version

1.3.0

License

MIT

Unpacked Size

12.6 kB

Total Files

17

Last publish

Collaborators

  • hakobpogh