redux-mw-ws

1.2.3 • Public • Published

redux-websocket-middleware

build status

  • Motivation
  • Installation
  • Usage
    • Middleware
    • Action Types
    • Actions

Create actions that dispatch to a websocket. For example:

function writeToSocket(data) {
  return {
    type: "WRITE_DATA",
    payload: data,
    meta: { socket: true }
  }
}
  • [x] Creating and opening the WebSocket for multiple endpoints (you can have one default)
  • [x] Handling JSON encoding/decoding of messages
  • [x] Retrying the connection when lost, and exponentially backing off
  • [x] Batching writes when offline, and sending when available
  • [ ] Tests

Package Sidebar

Install

npm i redux-mw-ws

Weekly Downloads

100

Version

1.2.3

License

MIT

Unpacked Size

20.9 kB

Total Files

5

Last publish

Collaborators

  • erudisch