Skip to content

Instantly share code, notes, and snippets.

@kulicuu
Last active October 24, 2016 13:36
Show Gist options
  • Select an option

  • Save kulicuu/6e540798778eb5f8229d7d722ba6255d to your computer and use it in GitHub Desktop.

Select an option

Save kulicuu/6e540798778eb5f8229d7d722ba6255d to your computer and use it in GitHub Desktop.
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 }
@kulicuu
Copy link
Author

kulicuu commented Oct 24, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment