Implement a function useEffectOnce(effect) that runs a provided callback function only a single time.
The function should:
effect.Examples
let count = 0; useEffectOnce(() => { count += 1; }); useEffectOnce(() => { count += 1; }); console.log(count); // 1
JavaScript Function
No test results yet
Click "Run" to execute tests