# redux-packed-observable-middleware

> Pack middleware for redux-observable

Latest version **0.0.1** (published 2019-06-10) · Apache 2.0 license · 0 weekly downloads

## Install

```sh
npm install redux-packed-observable-middleware
pnpm add redux-packed-observable-middleware
yarn add redux-packed-observable-middleware
bun add redux-packed-observable-middleware
```

## Health

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

Positive: has types; no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2019-06-10 |
| First published | 2019-06-10 |
| Weekly downloads | 0 |
| License | Apache 2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | iamawebgeek |

## Links

- npm: https://www.npmjs.com/package/redux-packed-observable-middleware
- Repository: https://github.com/iamawebgeek/redux-packed
- npm.io page: https://npm.io/package/redux-packed-observable-middleware

## Recent versions

- 0.0.1 (latest) — 2019-06-10

## README

# redux-packed

Modularize your redux code into small packs, combine and extract for final usage.


[![](https://img.shields.io/npm/v/redux-packed.svg)](https://www.npmjs.com/package/redux-packed)
[![](https://img.shields.io/npm/dt/redux-packed.svg)](https://www.npmjs.com/package/redux-packed)
[![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/iamawebgeek/redux-packed/blob/master/LICENSE)


## Installation
Installing using node package manager.
Type the following in your console inside your project directory:
```
npm install redux-packed --save
```

With yarn:
```
yarn add redux-packed
```

## Usage

```typescript
import { createPacker, updateState, PackData } from 'redux-packed'

const { createPack, combinePacks, extractPack } = createPacker([])

type Store = {
  count: number
}

type Actions = {
  increment: () => ({ type: string })
  decrement: () => ({ type: string })
}

type Packs = [PackData<Store, {}, Actions>]

const pack = createPack<Packs>([
  {
    initial: {
      count: 0,
    },
    actions: {
      INCREMENT: undefined,
      DECREMENT: undefined,
    },
    reducerCreator: (actions, selectors) => ({
      [`${actions.increment}`]: updateState(selectors.count, (value) => value + 1),
      [`${actions.decrement}`]: updateState(selectors.count, (value) => value - 1),
    }),
  },
])

const combinedPack = combinePacks({
  moduleA: pack,
})

const { actions, reducer, selectors } = extractPack(combinedPack)

const store = createStore(reducer)

store.dispatch(actions.increment()) // Dispatch action with type MODULE_A/INCREMENT
console.log(selectors.count(store.getState())) // 1
```

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