This package has been deprecated

Author message:

This package is no longer maintained.

@mkusaka/reproduce
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

@mkusaka/reproduce

install

npm

npm install @mkusaka/reproduce ---save

yarn

yarn add @mkusaka/reproduce

usage

import { reproduce } from "@mkusaka/reproduce"

const reducer = (state: {
  age: number,
  name: string
}, action) => {
  switch (action.type) {
    case "increment":
      // returns new object.
      // reproduce avoid to modify argument directly.
      // just as Immer's produce.
      return reproduce(state, (state) => {
        state.age++
      })
    default:
      return state
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @mkusaka/reproduce

Weekly Downloads

5

Version

0.0.3

License

MIT

Unpacked Size

5.64 kB

Total Files

12

Last publish

Collaborators

  • mkusaka