# redux-typed-action-reducer

> strongly typed reducer and action creator

Latest version **0.0.1** (published 2017-06-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install redux-typed-action-reducer
pnpm add redux-typed-action-reducer
yarn add redux-typed-action-reducer
bun add redux-typed-action-reducer
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2017-06-27 |
| First published | 2017-06-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | sliv |
| Maintainers | sliv |
| Keywords | functional, react, reducer, redux, typescript |

## Links

- npm: https://www.npmjs.com/package/redux-typed-action-reducer
- Repository: https://github.com/slivcode/redux-typed-action-reducer
- Homepage: https://github.com/slivcode/redux-typed-action-reducer#readme
- Issues: https://github.com/slivcode/redux-typed-action-reducer/issues
- npm.io page: https://npm.io/package/redux-typed-action-reducer

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2017-06-27

## README

# Redux Typed Action Reducer

## introduction

Typescript Redux Reducer Helper.

## Example

```typescript
import TypedReducer from 'redux-typed-action-reducer';
const ASwitch = TypedReducer<boolean>({ ns: 'switch', init: false })({
  set: (b:boolean) => orgState => b,
});

// => (type: 'switch', args: [true])
ASwitch.toggle(true);

// => 'switch::toggle' 
ASwitch.toggle['type'];

// => roughly
// (pr = false, {type, args}) => {
// const actions = {
//  toggle: (arg) => (org) => arg;
// } 
// if (actions[type]) return actions[type](...args)(pr);
// return pr;
// }
ASwitch.reducer
```

---
_Source: https://npm.io/package/redux-typed-action-reducer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
