Skip to content

Instantly share code, notes, and snippets.



Last active Aug 29, 2015
What would you like to do?
Flux over the Wire server.js
const server = new FluxServer(8080);
const messageList = server.Store('/messageList');
messageList.set('nextId', 0).commit();
const postMessage = server.Action('/postMessage')
.onDispatch(({ nickname, message }) => {
messageList.set(messageList.get('nextId') + 1, { nickname, message })
.set('nextId', messageList.get('nextId') + 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment