rooks
Version:
Collection of awesome react hooks
13 lines (12 loc) • 426 B
TypeScript
/**
* useEffectOnceWhen hook
*
* @description It fires a callback once when a condition is true or become true.
* Fires the callback at most one time.
*
* @param callback The callback to fire
* @param when The condition which needs to be true
* @see https://rooks.vercel.app/docs/hooks/useEffectOnceWhen
*/
declare function useEffectOnceWhen(callback: () => void, when?: boolean): void;
export { useEffectOnceWhen };