News for hackers. Stuff that matters.
Re:Marty.js – A JavaScript library for state management in R... by rattray on Wednesday January 21, 2015 @10:28AM (#8923460)
This looks great. The docs really are terrific, too.

Personally, I've been playing around with Bacon.js (or RxJS) instead of the Flux dispatcher. Using `Bacon.update` in conjunction with Facebook's Immutable.js seems really promising. The outcome is a far more functional approach.

A quick and dirty example: https://gist.github.com/rattrayalex/dee40d86813bcaa9de80

Re:Marty.js – A JavaScript library for state management in R... by RobertKerans on Wednesday January 21, 2015 @10:51AM (#8923573)
Thanks for posting that, I've just been trying to get something similar to work using Bacon, and was looking for some examples of how to approach it.
Re:Marty.js – A JavaScript library for state management in R... by dugmartin on Wednesday January 21, 2015 @01:56PM (#8924767)
Interesting use of a bus for each action. I'm curious why you used @setProps() instead of just storing the person object in the component state? Modifying props seems a like non "Reactish".
Re:Marty.js – A JavaScript library for state management in R... by rattray on Wednesday January 21, 2015 @11:47PM (#8927581)
Actually, I think you've changed my mind on this.

The reason is that I'm coming from a React/Backbone background (see [0]), where the Backbone Model was passed in as a prop, and then also listened-to within the component. So in that context it would make more sense for it to be `props` instead of `state`. In this case, you can't really pass the person object in as props and then listen to it for changes from within the component, since the object is different from the stream "emitting" it. When the emitter and the object are different things, it makes sense that the emitter comes from `props` (or is directly `require()`'d, which may be an anti-pattern?) and the object is set in `state`.

[0] http://www.toptal.com/front-end/simple-data-flow-in-react-ap...

Re:Marty.js – A JavaScript library for state management in R... by computmaxer on Wednesday January 21, 2015 @11:21AM (#8923752)
Have you considered omniscient with Immutable.js? https://www.npmjs.com/package/omniscient
Re:Marty.js – A JavaScript library for state management in R... by rattray on Wednesday January 21, 2015 @11:40PM (#8927566)
It was the inspiration for my current setup, actually!

Ultimately, pure-Bacon seems more functional, and I wanted to use something where all the "primitives" (Immutable, Bacon, etc) can be used directly, and are extremely well-supported. I may add a few abstractions (eg; a basic Mixin for event-binding, along the lines of [0]), but would prefer not to have a framework that "does too much" or has much magic, at least until it's very widely-used.

[0] https://www.npmjs.com/package/fluxbone

Re:Marty.js – A JavaScript library for state management in R... by Touche on Wednesday January 21, 2015 @12:48PM (#8924314)
Last time I looked the combination of all of those frameworks is quite large (like 400k+ IIRC).
Re:Marty.js – A JavaScript library for state management in R... by colinramsay on Wednesday January 21, 2015 @10:57AM (#8923605)
It took me a second for this to click but it looks fantastic. It'd be good to follow this up with a larger example - what are the issues you foresee?
Re:Marty.js – A JavaScript library for state management in R... by mjohn on Wednesday January 21, 2015 @12:18PM (#8924103)
I recently used React + Bacon + Immutable in a small project and I haven't come across any issues yet. I haven't seen any larger-scale examples yet, but this blog post[0] was interesting and has links at the bottom to implementations of todomvc and the flux-chat example.

[0] http://blog.hertzen.com/post/102991359167/flux-inspired-reac...

Re:Marty.js – A JavaScript library for state management in R... by rattray on Wednesday January 21, 2015 @11:55PM (#8927596)
That post's code provided inspiration for this! Though I found their examples a bit over-engineered for my taste...
Re:Marty.js – A JavaScript library for state management in R... by rattray on Wednesday January 21, 2015 @11:53PM (#8927593)
Hopefully you'll see a blog post from me on this in the coming weeks =)

I'm a little worried about finding a good answer to the Flux Dispatcher's elegant `waitFor`, but I have a few ideas that I think could handle that well. I'm also worried about "stream spaghetti", especially having streams defined outside of a central `Actions.js`. I'm not yet sure how to elegantly handle server-syncing, though again, I have a few ideas (and Marty seems to provide some too). Lastly, I don't know the performance characteristics of Bacon or RxJS.