This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); |
OlderNewer