# redux-ipc

> Log your Redux state and actions to a node backend via WebSockets.

Latest version **0.4.0** (published 2016-08-20) · MIT license · 0 weekly downloads

## Install

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

## 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.4.0 |
| Published | 2016-08-20 |
| First published | 2016-08-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Vu Tran |
| Maintainers | vutran |
| Keywords | redux, websocket, socket, ipc, rpc |

## Links

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

## Dependencies (2)

- [ws](https://npm.io/package/ws.md) ^1.1.1
- [redux](https://npm.io/package/redux.md) ^3.5.2

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.4.0 (latest) — 2016-08-20
- 0.3.0 — 2016-08-19
- 0.2.1 — 2016-08-19
- 0.2.0 — 2016-08-19
- 0.1.0 — 2016-08-19
- 0.0.0 — 2016-08-16

## README

# redux-ipc
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)


> Log your Redux state and actions to a node backend via WebSockets.

## Install

```bash
$ npm install --save redux-ipc
```

![Demo](demo.gif)

## Usage

Apply the middleware when creating your Redux store.

```js
const reduxIpcMiddleware = require('redux-ipc');

const state = {
  todos: [],
};

// apply the middleware
const store = createStore(state, {}, applyMiddleware(reduxIpcMiddleware));

// dispatch actions
// store.dispatch(...);
// store.dispatch(...);
// store.dispatch(...);
```

Create the server to listen for messages.

```js
const Server = require('redux-ipc').Server;

const PORT = process.env.REDUX_IPC_PORT || 8080;
const PROTOCOL = process.env.REDUX_IPC_PROTOCOL || 'redux-ipc';

// create a new redux ipc server
const wss = new Server({ port: PORT, socketName: PROTOCOL });

// listen to messages
wss.on('message', message => {
  console.log(message);
});
```

## Examples

Run `npm install` and `npm start` for each directory in `/examples`.

*Note: Examples are based on the official Redux examples with slight modifications to showcase the IPC functionality.*

## License

MIT © Vu Tran

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