npm.io
1.2.3 • Published 8 years ago

redux-mw-ws

Licence
MIT
Version
1.2.3
Deps
2
Size
20 kB
Vulns
0
Weekly
0

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 }
  }
}
  • Creating and opening the WebSocket for multiple endpoints (you can have one default)
  • Handling JSON encoding/decoding of messages
  • Retrying the connection when lost, and exponentially backing off
  • Batching writes when offline, and sending when available
  • Tests

Keywords