@wbe/use-did-update
TypeScript icon, indicating that this package has built-in type declarations

2.7.1 • Public • Published

@wbe/use-did-update

Execute effect only when state or props is updated.

Installation

$ npm install -s @wbe/use-did-update

How to use

import { UseDidUpdate } from "@wbe/use-did-update";

example

const App = ({ count }) => {
  useDidUpdate(() => {
    console.log("Will be called only if count props change");
  }, [count]);
};

Parameters / Props

params type description default value
effect ()=> void effect to execute /
dependencies any[] dependencies array of argument(s) allowing to re-suscribre to the effect /

Returns

void

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.7.112latest

Version History

VersionDownloads (Last 7 Days)Published
2.7.112
2.7.01
2.4.00
2.3.00
2.2.0-alpha.00
2.1.00
2.0.00
2.0.0-alpha.110
2.0.0-alpha.100
2.0.0-alpha.70
2.0.0-alpha.60
2.0.0-alpha.30
2.0.0-alpha.20
2.0.0-alpha.10
2.0.0-alpha.00
1.6.00
1.5.00
1.4.20
1.4.2-alpha.00
1.4.10

Package Sidebar

Install

npm i @wbe/use-did-update

Weekly Downloads

13

Version

2.7.1

License

MIT

Unpacked Size

23.1 kB

Total Files

18

Last publish

Collaborators

  • willybe