Live data from Hacker News

Marty.js – A JavaScript library for state management in React applications

martyjs.org

31–40 of 95 posts

Re: Marty.js – A JavaScript library for state management in React applications

#31
post #24

Nice documentation. But I don't see anything groundbreaking here. The whole rationale for Flux is to unidirectional state flow, and it does that quite well. A lot of library creators have focused on the tiny quibbles with "ease of use" around stores and constants –– "state management" is a good euphemism for this need –– but that's not really a bottleneck for me. I can manage my constants manually with Flux, and add…

Hey, author here. This is a repeat of my answer below but it's right down the bottom so might be missed: I found that no other Flux implementation really helped with fetching data in a Fluxy way. There tended to be a lot of boiler plate code for binding stores to components. Furthermore, there was a lack of tooling for debugging. Marty helps combat these issues by introducing a number of new things: - Fetch API for f…

You're right about the boilerplate. I use a wrapper around React.createClass to take care of that. Kinda similar to Marty.createStateMixin, but it's just a component factory.

The Chrome plugin looks very nice, but you can do the same thing with console.log() outputs in your store. It's a nice to have, but not filling a need for me.

Re: Marty.js – A JavaScript library for state management in React applications

#32
This looks really neat, and the documentation does seem nice. What I would absolutely love (and I'm sure many others as well) is a tutorial that shows how to build a very simple app from scratch... like a list of records and then click on a record to bring up an edit form (something super basic, but a tad more complex than TodoMVC). The problem I have is wrapping my head around how I put all the pieces together. Thanks!

Re: Marty.js – A JavaScript library for state management in React applications

#33

I'm scanning the documentation for this now and the "state sources" concept looks useful. Stores seem to be a bit cleverer than in other Flux implementations too. The fact it's got a Chrome extension and what appears to be comprehensive documentation bodes well. I'm currently using reflux because I like its simplicity (no dispatcher and no action creators) but Marty has definitely piqued my interest. Edit: Question f…

Isomorphic apps are the next big challenge. Right now the biggest blocker is that everything's a singleton. I'm working on an internal container which should hopefully mean existing apps can be made isomoprhic without a change to the API

Re: Marty.js – A JavaScript library for state management in React applications

#34

Does marty.js support the concept of an app context? The only implementation i know of is Yahoo's fluxible ( https://github.com/yahoo/fluxible ). This is mainly useful when you're trying to render your flux app on the server.

Not right now but isomorphisim is the next big feature I'm going to be working on

Re: Marty.js – A JavaScript library for state management in React applications

#36
post #15

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

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?

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 React applications

#37

Nice documentation, and dev tools is a big plus. The beauty of flux + react is, it's so simple and flexible. I'm developing a fairly complex application with flux + react, (no flux frameworks, just facebook's dispatcher and stores/actions modelled after facebook's flux examples), and it seems I've implemented lots of things in marty.js. I also started using mixins for subscribing views to stores, immutable data in st…

If you want a framework with immutability you should probably just use https://github.com/Raynos/mercury as it gets rid of React's unnecessary component state.

Re: Marty.js – A JavaScript library for state management in React applications

#38

Out of curiosity, for those of you building stuff with Flux: Which library do you use? Or do you just use your own implementation? We recently went with Reflux[1] for our first big React app after reading about it here[2], and I've been pretty happy with it so far. [1] https://github.com/spoike/refluxjs [2] https://reactjsnews.com/the-state-of-flux/

I'm using Reflux for now, though I'm tempted to switch to something more FRP like Bacon, f, or RxJS. I find that I end up making stores for both AllThings and CurrentThing, and it should be easier to express that relationship with FRP.

I've been using a "FilteredConnect" mixin that I wrote that's solved the "CurrentThing" store problem nicely.

Re: Marty.js – A JavaScript library for state management in React applications

#39
This looks to be a well-put-together implementation of flux. I recently looked over around 20 or so flux libraries to use for a react app I had started, and found only a couple that I liked. I would put this one near the top, but the one I ended up choosing has been great, but no one seems to know about it!

If anyone is interested: https://github.com/kjda/ReactFlux

It's very similar, but I think I like how Actions and subscriptions to actions are handled with it better.

Re: Marty.js – A JavaScript library for state management in React applications

#40

Earlier quoted context omitted.

I'm using Reflux for now, though I'm tempted to switch to something more FRP like Bacon, f, or RxJS. I find that I end up making stores for both AllThings and CurrentThing, and it should be easier to express that relationship with FRP.

I've been using a "FilteredConnect" mixin that I wrote that's solved the "CurrentThing" store problem nicely.

Interesting. Link?
Post reply on HN