K2 Javascript Utilities offers several utilities packages. The effects package privides reusable react effects.
npm install @k2_tools/utils
import {effects} from "@k2_tools/utils";
K2_tools effect utilities offers some reusable react effects.
noEffect
The noEffect()
method does nothing. It is useful for returning from react useEffect
hooks as the cancel effect.
useEffect(() => {
...
return noEffect;
}, []);
Prevents the effect from re-executing as a cancel effect when the component re-renders.