Last active
October 24, 2016 13:36
-
-
Save kulicuu/6e540798778eb5f8229d7d722ba6255d to your computer and use it in GitHub Desktop.
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
| c = console.log.bind console | |
| Imm = require 'immutable' | |
| EventEmitter = require 'events' | |
| class Emitter extends EventEmitter | |
| Dispatch = new Emitter() | |
| side__effects = require('./side__effects__.coffee').amon_tobin({ Dispatch }) | |
| reducer = require('./reducer__.coffee').default | |
| module.exports = ({ primus }) -> | |
| initial__state = Imm.Map | |
| primus: primus # i wonder about putting large important objects into a State imm object like this ? | |
| dispatch_initialised: false | |
| primus_initialised: false | |
| Desires: [{43: "various startup development desires"}, {43: 'init primus'}] | |
| Transactions: [] | |
| State = initial__state | |
| Dispatch.on 'new_action', ({ payload }) -> | |
| State = reducer { State, payload } | |
| side__effects { State } | |
| side__effects { State } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Basically wanted a Redux on the server side because everything is WebSockets and streaming Postgres and Redis which is like streaming also. Basically 3+ full duplex channels blazing really don't want to try to manage that with classic MVC OOP. Want Functional-Reactive and something disciplined like Flux.