1.2.2 • Published 4 months ago

use-immer-produce v1.2.2

Weekly downloads
445
License
Apache-2.0
Repository
github
Last release
4 months ago

use-immer-produce

React Hook nearly identical to use-immer, but it returns the draft from the update function.

Installation

npm i use-immer-produce immer

Usage

const [testObj, updateTestObj] = useImmerProduce({
    value: 14
});

In order to immediately extract the draft, before re-render:

const draft = updateTestObj((draft) => {
    draft.value = 75;
});

Contributing

All contributions are welcome, please open an issue or pull request.

To use this repository: 1. npm i -g pnpm (if don't have pnpm installed) 2. pnpm i 3. npx projen (this will ensure everything is setup correctly, and you can run this command at any time) 4. Good to make your changes! 5. You can run npx projen build at any time to build the project.

1.2.2

4 months ago

1.2.0

4 months ago

1.2.1

4 months ago

1.1.1

2 years ago

1.1.0

3 years ago

1.0.5

3 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago