# swop

> swop

Latest version **0.2.0** (published 2018-03-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install swop
pnpm add swop
yarn add swop
bun add swop
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2018-03-09 |
| First published | 2018-03-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Volkan Ozcelik |
| Maintainers | volkan |
| Keywords | swop |

## Links

- npm: https://www.npmjs.com/package/swop
- Repository: https://github.com/jsbites/swop
- Homepage: https://github.com/jsbites/swop#readme
- Issues: https://github.com/jsbites/swop/issues
- npm.io page: https://npm.io/package/swop

## Recent versions

- 0.2.0 (latest) — 2018-03-09
- 0.1.1 — 2018-03-02
- 0.1.0 — 2018-03-02

## README

I will add more, but just as a quick usage example.

Assume you have actions `ADD_TO_DO`, `REMOVE_TO_DO`, and reducers `addToDo` and `removeToDo`.

Then…

```javascript
import swop from 'swop';

// constants and reducers are defined here.

// Export a higher-order reducer that switches to the reducer that the action maps to 
// or defaults to an identity reducer if there’s not matching action.
export default swop({
  [ADD_TO_DO]: addToDo,
  [REMOVE_TO_DO]: removeToDo
});
```

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