Altinet
  • Home
  • Blog
  • Contact





The React Redux

On 06 Sep, 2015
Uncategorized
By : Bruno Samardzic
No Comments
Views : 4539

It’s funny how things that make you cringe and yell at your screen at first, can also make you fall in love into them. I guess good ideas are pretty much like womenSmile. When I go back and think about the first time I saw React, it was pretty much like that: Inline html with js? Are you kidding me?! Why would I go through the trouble?! Virtual DOM, properties, states? How is that stuff supposed to make development simpler?! What the hell is wrong with this world?! But then, that hunch of brilliance would just keep nagging you to further explore these crazy ideas and why they just might work. And the end result is that you not only learn to appreciate the tech, you start loving it.

Now, the one problem with React that people were trying to solve since they learned to love it is: now what? How do we connect it with our data and handle it with minimal boilerplate? I was skeptical about Flux from day one but see that’s the difference: I hated React when I saw it, but I was just kinda skeptical about Flux. It’s much harder to grow out of skepticism into a romance. You can have a sort of a steady relationship with no frills with that kind of start, but nothing close to real romance. There were too many questions lingering (how many stores, how do I organize and track them? Why so much code to connect them? Do I store anything on a component or not, what about change tracking? etc…) and you were pretty much left on your own to answer them. If you searched for an explanation or best practices, the general answer would be “it depends”. And I must admit, the whole ambiguity about “The right way”TM also cooled down my love for React.

A few days ago I ran into what seem to me as just-another-flux-also-ran called Redux. But after reading about it, I actually hated it. It seemed to simple and dumbed down, and introduced ideas like single state storage. This post started 2 weeks ago as a rant about sorry state of Flux and especially about Redux as a extremely stupid solution for the problem. But the same thing that happened with React, happened with Redux. The ideas clicked and love was bornSmile. Now there are a lot of good articles and videos about Redux, so I won’t go into explaining the details. It’s actually pretty simple pub-sub system but scalable. The boilerplate is minimized but flexibility is still there, and it delivers on one thing I had trouble with other Flux solutions: simple implementation of single source of truth (without huge amount of hooks and boilerplate). It’s so good that even some developers of competing solutions stopped developing their own and switched. It’s also under development at break-neck speed (it changed from v1 to v2 in 2 weeks) and the support and documentation is awesome. It still needs some questions answered and stuff tweaked but I expect it to become a de-facto standard for development of React application. Check out Dan Abramov’s video about Redux:

https://www.youtube.com/watch?v=xsSnOQynTHs

and the Redux github.  Oh, and as an added plus, check out my sample application built with React and Redux

https://github.com/brunoAltinet/react-redux-example

 

Cheers!



Previous Post Next Post 

About The Author

Bruno Samardzic


Number of Posts : 45
All Posts by : Bruno Samardzic

Leave a Comment

Click here to cancel reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>





Recent Posts

  • Angular vs React: round 2
  • Why programming is hard
  • Orchard Workflows, undocumented gem
  • The React Redux
  • React.js invoicing CRUD application, part 2: Description

Recent Comments

  • Angshuman on Animation for starred grid rows and columns using xaml
  • Advanced Excel Training in Lucknow on Angular vs React: round 2
  • Reginald Sophomore on My example of Angularjs directive
  • Slobodan on Angular and Breeze – story so far.
  • Bruno Samardzic on Reaction to Ember-forged Durandal Angularly Knocking out my Backbone, or my JS MVC framework research conclusion.

Contact

Altinet d.o.o.

OIB: 97429091194

Čulinečka cesta 146, Zagreb

Tel: +385 (1) 2946 819

Mob: +385 (98) 210 756

IBAN: HR4323400091110406470

Latest tweets