useShallowEffect ​
Hook that executes an effect only when dependencies change shallowly or deeply
lifecycle
low
test coverage
Last changed: 3 months ago
Installation ​
Library
CLI
Manual
typescript
import { useShallowEffect } from '@siberiacancode/reactuse';Usage ​
typescript
useShallowEffect(() => console.log("effect"), [user]);Demo ​
Api ​
Parameters
| Name | Type | Default | Note |
|---|---|---|---|
| effect | EffectCallback | - | The effect callback |
| deps? | DependencyList | - | The dependencies list for the effect |
Type declaration ​
typescript
import type { DependencyList, EffectCallback } from 'react';Source ​
Source • DemoContributors ​
D