# cape-redux

> A few redux helper/utility functions.

Latest version **3.3.1** (published 2019-07-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install cape-redux
pnpm add cape-redux
yarn add cape-redux
bun add cape-redux
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.3.1 |
| Published | 2019-07-11 |
| First published | 2016-09-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 16.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Kai Curry |
| Maintainers | kaicurry |

## Links

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

## Dependencies (3)

- [jart](https://npm.io/package/jart.md) ^1.0.0
- [redux](https://npm.io/package/redux.md) ^4.0.4
- [lodash](https://npm.io/package/lodash.md) ^4.17.14

## Recent versions

- 3.3.1 (latest) — 2019-07-11
- 3.3.0 — 2019-02-12
- 3.2.0 — 2017-05-21
- 3.1.0 — 2016-12-05
- 3.0.0 — 2016-12-03
- 2.3.0 — 2016-11-24
- 2.2.1 — 2016-11-21
- 2.2.0 — 2016-11-15
- 2.1.1 — 2016-11-13
- 2.1.0 — 2016-11-12
- 2.0.0 — 2016-11-12
- 1.6.1 — 2016-11-11
- 1.6.0 — 2016-11-09
- 1.5.1 — 2016-10-20
- 1.5.0 — 2016-10-11
- … 13 more at https://npm.io/package/cape-redux/versions

## README

# cape-redux

- `addListener(selector, store, onChange)` - Trigger a call to onChange() when result of selector changes.
- `createAction(type, payloadCreator)` - Makes an action creator.
- `createReducer(reducers, defaultState = {}, opts)` - Send reducers obj where key is type and value is func with (state, payload) sig. Default opts `{ actionPick: property('payload'), skipErrors: true, skipNoPayload: false }`. This will skip over actions with errors but allow actions with no payload to be sent to the action type reducers. Can pass `isInvalidAction()` in opts to add some custom checking.
- `mapDispatchToProps(getActions)` - getActions func is passed state. Result is passed to bindActionCreators.
- `merge(object, [sources])` - Creates a new object with the result of sources spread over object.
- `noopAction(typeId)` - Returns a function that will always return an the exact same object with a type prop set to typeId.
- `fpMerge(source, object)` - Curried. Object is 2nd arg.
- `imSet(key, obj, value)` - curried. Calls `set` on object with `key` and `value` arguments.
- `set(key, obj, value)` - curried. return new object with key set as value on obj. No array support.
- `setIn(arrayPath, obj, value)` - curried. Returns new objects created along path until value is set. Uses `set` internally.
- `thunkAction` - Like createSelector but it builds and dispatches an action creator. To dispatch many actions return array from builder function.
- `selectorAction(type, payloadSelector, metaSelector = noop)` Uses thunkAction to create an action from selectors.
- `thunkSelectorAction(actionSelector)` A selector that returns an action object after it is sent state. Dispatch is called on action.

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