socket.red
A websocket server for executing your apis, dispatching redux actions on clients and emitting events from server.
Installation
$ npm install --save socket.red
Usage
const startServer = ; // Your api provider { thissession = session; } // A simple api that returns a value, error or promise { // the api can throw error, which is received at the remote end if !numberOfHands throw 'Cannot clap without any hands'; // The api can return via promise if numberOfHands > 2 return { }; // The api can return immediately as well return `Clap Clap Clap with `; } // A more useful api that can dispatch action to all the clients { const rec = db; Object; } const allSessions = {}; // This is how you start the server;