# wtc-sub-middleware

> We The Curious actions subscription middleware

Latest version **1.3.2** (published 2019-08-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install wtc-sub-middleware
pnpm add wtc-sub-middleware
yarn add wtc-sub-middleware
bun add wtc-sub-middleware
```

## 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 | 1.3.2 |
| Published | 2019-08-06 |
| First published | 2019-07-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Alexander Shved |
| Maintainers | shved90 |

## Links

- npm: https://www.npmjs.com/package/wtc-sub-middleware
- npm.io page: https://npm.io/package/wtc-sub-middleware

## Dependencies (1)

- [mqtt](https://npm.io/package/mqtt.md) ^3.0.0

## Recent versions

- 1.3.2 (latest) — 2019-08-06
- 1.3.1 — 2019-08-05
- 1.3.0 — 2019-08-05
- 1.2.1 — 2019-08-02
- 1.2.0 — 2019-08-02
- 1.1.0 — 2019-07-26
- 1.0.0 — 2019-07-26

## README

## We The Curious actions middleware 

This is a piece of middleware used in react redux app to pass actions to a broker via _MQTT_.

#### How to use:
```javascript
import { createMQTTMiddleware } from 'wtc-sub-middleware'
createMQTTMiddleware('http://localhost:1884', '--origin--')
```
Origin is an optional parameter that gets added to final published output

Accepts a url parameter, publishes current action, and then passes that same action back into the store.

By default subscribed to _all_ actions, can be changed to subscribe to specific list of action like so:
```javascript
client.subscribe(['BUTTON_PRESS', 'TOGGLE_SWITCH'])
```

Some basic error catchers. Looks for a broker connection every 10s.

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