Closed bcomnes closed 8 years ago
Not as far as I know but there are some examples using immutable.js and backbone if you need the reference: https://github.com/Raynos/mercury/tree/master/examples/unidirectional
I guess I'll start there. Unfortunately the redux bindings for react are a bit beyond trivial: https://github.com/rackt/react-redux/blob/master/src/components/connect.js I'll share back if I find out anything interesting. Should I close the issue for now?
@bcomnes i've been playing with redux+react+hyperscript recently and its pretty nice. may be what you're looking for. https://github.com/kumavis/reddit-images
Thanks @kumavis! I'll look through it for some hints. I'm curious what using mercury for the view layer and redux for the app state would look like, but I can't find any examples, but I'm thinking I'll have to fully understand where the two projects overlap first.
@bcomnes i've had fun with redux + vdux + virtual-dom. for examples, see conway-redux-vdom and linked-data-browser.
mercury for the view layer and redux for the app state
mercury is mostly observ
for the observable state graph and virtual-hyperscript
for the view, w/o any opinionated component format.
I'm going to close this for now. I think I need to take some time to sit with both tools in order to understand the overlap some more. I'll revisit in the future if I think its worth writing something up. If someone else feels like its worth it, feel free!
For what it's worth, I've started to think of Mercury as a really good viewmodel. If your application is essentially a UI, then the viewmodel might suffice, and there's not much point adding another state layer on top of it. However, in the project I was working on, we had a more complicated state that was shared peer-to-peer using crdt. It was easiest to treat the replicated datastore as the model, then render any changes in it to Mercury's viewmodel, then render from there to the DOM in the usual Mercury fashion.
I agree with @eightyeight
I think mercury state representation makes a good view / viewmodel.
You want to model and persist the raw data somewhere else; whether thats crdt or some other set of classes.
@raynos so if you are interacting with an API you'd recommend storing the resultant raw data in redux?
Has anyone put together an example of using mercury with redux?