Live data from Hacker News

React in patterns

github.com

1–10 of 52 posts

Re: React in patterns

#4
I am struggling a little with Flux, everyone has their own implementation of it. I mean that is grand, but what does it actually mean for me? Contextless.

Thanks for sharing :)

Re: React in patterns

#6
post #4

I am struggling a little with Flux, everyone has their own implementation of it. I mean that is grand, but what does it actually mean for me? Contextless. Thanks for sharing :)

Honestly, people are just settling on redux. It builds on flux and really is pretty easy to use. Is it the best solution? No idea, but it works and it's quickly becoming the de facto implementation.

Re: React in patterns

#7
post #4

I am struggling a little with Flux, everyone has their own implementation of it. I mean that is grand, but what does it actually mean for me? Contextless. Thanks for sharing :)

When I was learning Flux I thought this video series[1] was really helpful. That being said, I've switched to Redux now and am much happier for it. If you're into videos I highly recommend Dan's (creator of Redux and on React core team) Egghead series[2].

[1] - https://www.youtube.com/watch?v=Pd6Ub7Ju2RM

[2] - https://egghead.io/courses/getting-started-with-redux

Re: React in patterns

#8
Ugh, the dependency injection stuff is just Angular all over again.

    export default wire(Title, ['title'], function resolve(title) {
      return { title };
    });
Now I have to register "title" somewhere. Where is it registered? Did I remember to register it? I no longer know what's going on just by looking at the file in front of me, and my linter is silent. Then I have to annotate the function and declare it in the argument list. Items will be added and removed from the two lists as the app evolves, introducing more mental overhead and increased surface area for bugs, since once again my linter will have nothing to say on the topic.

Surely I'm in the minority given how popular Angular was, but I felt "DI" was the absolute worst thing about Angular's approach—basically a DSL layered over JS requiring yet more specialized tooling. The ability to look at just one file and understand it goes hand-in-hand with static analyzability, and I'd hate for the React community to abandon that and go down this path.

[edit] In the spirit of not dwelling on the negative, I should also say I did find most of the article to be a good summary of design patterns. Nice job!

Post reply on HN