# @nju33/reducer-action

> [![CircleCI](https://circleci.com/gh/nju33/react-a.svg?style=svg&circle-token=9c6b0217483ac8aca3220b42a652f08e0b36cfa4)](https://circleci.com/gh/nju33/react-a) [![TypeScript](https://badges.frapsoft.com/typescript/code/typescript.svg?v=101)](https://githu

Latest version **0.0.2** (published 2018-11-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @nju33/reducer-action
pnpm add @nju33/reducer-action
yarn add @nju33/reducer-action
bun add @nju33/reducer-action
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2018-11-08 |
| First published | 2018-11-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10.13.0 |
| Dependencies | 0 |
| Unpacked size | 2.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | nju33 |
| Maintainers | nju33 |
| Keywords | type |

## Links

- npm: https://www.npmjs.com/package/@nju33/reducer-action
- Repository: https://github.com/nju33/reducer-action
- Homepage: https://github.com/nju33/nju33/reducer-action
- Issues: https://github.com/nju33/nju33/reducer-action/issues
- npm.io page: https://npm.io/package/@nju33/reducer-action

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2018-11-08
- 0.0.1 — 2018-11-08

## README

# ReducerAction

[![CircleCI](https://circleci.com/gh/nju33/react-a.svg?style=svg&circle-token=9c6b0217483ac8aca3220b42a652f08e0b36cfa4)](https://circleci.com/gh/nju33/react-a)
[![TypeScript](https://badges.frapsoft.com/typescript/code/typescript.svg?v=101)](https://github.com/ellerbrock/typescript-badges/)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

## Install

```bash
yarn add -D @nju33/reducer-action
```

## Example

```ts
import {ReducerAction} from '@nju33/reducer-action';

const enum ActionType {
  A,
  B,
}

const action = {
  a() {
    return {
      type: ActionType.A as ActionType.A,
      payload: {
        foo: 'foo',
      },
    };
  },
  b() {
    return {
      type: ActionType.B as ActionType.B,
      payload: {
        bar: 'bar',
      },
    };
  },
};

type Action = ReducerAction<typeof action>;

const aAction: Action = action.a() as any;

switch (aAction.type) {
  case ActionType.A: {
    aAction.payload.foo;
    break;
  }
  case ActionType.B: {
    aAction.payload.bar;
    break;
  }
  default:
}

```

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