Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oakfang/rehub
A Redux middleware to share actions via WebRTC
https://github.com/oakfang/rehub
Last synced: 3 months ago
JSON representation
A Redux middleware to share actions via WebRTC
- Host: GitHub
- URL: https://github.com/oakfang/rehub
- Owner: oakfang
- License: mit
- Created: 2017-01-19T10:39:51.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-19T18:00:20.000Z (about 8 years ago)
- Last Synced: 2024-09-22T01:24:04.291Z (4 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 4
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rehub
A Redux middleware to share actions via WebRTC## Usage
### Client
```js
// store.js
import { createStore, applyMiddleware } from 'redux';
import rehub from 'rehub';
import reducers from './reducers';export default applyMiddleware(rehub({
signaling: 'ws://localhost:9000', // this is your signaling server, see below
action: [
'ADD_CLICK' // these actions will be shared across all peers
],
}))(createStore)(reducers);
```### Server
```js
const express = require('express');
const http = require('http');
const getSignalingServer = require('rehub/server');const app = express();
const server = http.createServer(app);
getSignalingServer({ server });module.exports = app;
```