Skip to content

Instantly share code, notes, and snippets.

View michaelcontento's full-sized avatar

Michael Contento michaelcontento

View GitHub Profile
var socket = require('socket.io-client')('http://127.0.0.1:3000');
socket.on('connect', function(io){
console.log('[CLIENT] connected');
var data = { name: 'hans' };
console.log('[CLIENT] sending json:', '(' + typeof data + ')', data);
socket.emit('json', data);
var data = 'hello world';
console.log('[CLIENT] sending string:', '(' + typeof data + ')', data);
@michaelcontento
michaelcontento / index.js
Created March 4, 2016 08:24
Split state in redux-storage
import * as storage from 'redux-storage'
import filter from 'redux-storage-decorator-filter';
import { createStore, applyMiddleware } from 'redux';
// For this example I'm using a simple in-memory engine. Thus should obiously
// be repalced with something real :-)
function createEngine(name, value) {
return {
load() {
return Promise.resolve(value);