Skip to content

useShallowEffect ​

Hook that executes an effect only when dependencies change shallowly or deeply.

lifecycle
test coverage
Last changed: 2 hours ago

Installation ​

Library
CLI
Manual
typescript
import { useShallowEffect } from '@siberiacancode/reactuse';

Usage ​

typescript
useShallowEffect(() => console.log("effect"), [user]);

Demo ​

Api ​

Parameters

NameTypeDefaultNote
effectEffectCallback-The effect callback
deps?DependencyList-The dependencies list for the effect

Type declaration ​

typescript
import type { DependencyList, EffectCallback } from 'react';

Source ​

Source • Demo

Contributors ​

D
debabin
debabin

Released under the MIT License.