Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

global-state

0.2.1 • Public • Published

global-state

Make a distributed app or a game using Redux and socket.io. All state is kept in the server and all clients are always in sync. When an action is dispatched in a client, it first goes through the server and all clients receive it in the same order.

Install

npm install global-state

Usage

Server-side

With hapi:

var io = require('socket.io')(server.listener);
require('global-state')(io);

Client-side

Using webpack:

import createGlobalStore from 'global-state-client';
import reducer from './myReducer.js'
 
var myStore = createGlobalStore({ room: 'myRoom', reducer }, () => 'Global state loaded!');

install

npm i global-state

Downloadsweekly downloads

13

version

0.2.1

license

MIT

repository

githubgithub

last publish

collaborators

  • avatar