Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Not to keep harping on this issue because I know we're way off topic, but I'm genuinely curious how the React code can be simplified because this was one of my main pain points using React. Reflux and alt were major improvements over the Facebook flux impl, but they still require the boilerplate I posted above. If you remove that then you have "Flux magic" :)

There's no Ext magic in the code I posted. Flux and MVC are different patterns. In MVC, the controller typically has direct access to the view and model which is why the code is simple:

    myView.setLoading(true);
    myModel.save(...)
That would look the same in Java Swing for example. Flux is a fundamentally different pattern and one that I really haven't seen the need for in the products we're building to justify it's disadvantages. But for some applications, it's probably the right solution.


And the reason you couldn't setup your stores in a similar fashion?

    myStore.setLoading(true);
    myStore.save(...);
Where the handling is in your action handler for whatever event was raised... This assumes you do your backend data access in the store itself... there are other options.


Sorry for the confusion: setLoading (poorly named) is a method on a view component in ExtJS 4 which displays a modal message mask.


No confusion.. you can have a property on your store that does the same to state, and triggers an event to draw a mask/modal in a similar way... there's nothing preventing you from doing that... it isn't so much in the box, but you can do it pretty easily.

You also aren't stuck building class based object constructors in JS as extjs projects tend to do.. or trying to shim out areas of extjs in order to extend a base rendering.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: