npm.io
1.3.2 • Published 7 years ago

handle-data-change

Licence
MIT
Version
1.3.2
Deps
1
Size
7 kB
Vulns
0
Weekly
0
DeprecatedThis package is deprecated

handle-data-change

npm version Conventional Commits code style: prettier

Handle data change.

  • Great Typescript support.
  • Meant to be used with React.

Usage

// index.ts
import HandleDataChange from "handle-data-change";

type Data = { foo: string; bar: number };

const handleChange = new HandleDataChange<Data>(
  { foo: "adsf", bar: 0 },
  data => {
    console.log(data);
  }
);

handleChange.change.bar(6);
handleChange.change.foo("hello world");
$ ts-node index.ts
{ foo: 'adsf', bar: 6 }
{ foo: 'hello world', bar: 6 }

Keywords