Skip to content
This repository has been archived by the owner on Jul 9, 2019. It is now read-only.

LeDDGroup/handle-data-change

Repository files navigation

handle-data-change

npm version Conventional Commits code style: prettier Greenkeeper badge

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 }