Twitter | Search | |
Daishi Kato
A freelance programmer. I'm interested in working remotely with people abroad:
2,393
Tweets
64
Following
619
Followers
Tweets
Daishi Kato 2h
Replying to @_y_y_m_m_
そんな方へ react-tracked
Reply Retweet Like
Daishi Kato 2h
Replying to @theKashey @acemarke
> they are always working "atomically" and can not work in other way. Agreed. My discussion was just about coding style.
Reply Retweet Like
Daishi Kato 3h
Replying to @theKashey @acemarke
Assuming we are discussing the same topic, I guess having one dispatch in a callback or in a useEffect reduces the problem. It should work more as expected. If I rephrase, my proposition is to organize our reducers so that it won't behave differently if React batches or not.
Reply Retweet Like
Daishi Kato 5h
Replying to @theKashey @acemarke
Hmm, what are different policies for firing changes (= dispatch actions)? It might not be a pure Redux problem, but we are discussing about the recommended coding pattern.
Reply Retweet Like
Daishi Kato 7h
Replying to @acemarke
I see. I can’t think of any other than a historical reason. So, it’d be appreciated if someone else could point it out. Thanks.
Reply Retweet Like
Daishi Kato 7h
Replying to @acemarke
Thanks for the response. What would be the valid reasons when we start developing a new app from scratch? Does some middleware require that pattern?
Reply Retweet Like
Daishi Kato 14h
I have been following this rule from the early days. It was so disappointing to see code having multiple dispatch calls. Wondering now if it's possible for the lib to detect this usage and prohibit or at least warn it.
Reply Retweet Like
Daishi Kato 15h
Replying to @onderonur_ @Medium
Hi, I have one of many more. Would you check out React Tracked and see if you like it? and with
Reply Retweet Like
Daishi Kato Dec 14
Replying to @acemarke
I'd say, even if RR is just a wrapper around , ecosystem is more than that. All those documents based on best practices are valuable. Some of them are also applicable to non-Redux bare context-based solution. I mean, the portion of library itself is small.
Reply Retweet Like
Daishi Kato Dec 14
React Tracked is a library for global state with and . It eliminates unnecessary re-renders automatically. Just added a more basic tutorial in React Tracked.
Reply Retweet Like
Daishi Kato Dec 13
has redux-thunk. state doesn't have any middleware system, but are composable. use-reducer-async provides thunk-like API for useReducer and has type definitions.
Reply Retweet Like
Daishi Kato Dec 13
Replying to @dai_shi
And, one more correction: useEffect(() => { (async () => {...})(); }, []); Well, they are pseudo code anyway.
Reply Retweet Like
Daishi Kato Dec 13
Replying to @dai_shi
Oops, one minor correction: if (!data) setData(...);
Reply Retweet Like
Daishi Kato Dec 13
Check out various data fetching patterns with or without . - Fetch-on-Render (useEffect) - Fetch-Then-Render - Fetch-on-Render (Suspense) - Render-as-You-Fetch (Suspense)
Reply Retweet Like
Daishi Kato Dec 13
For me, the difference among Redux / MobX / React-Tracked is: - Redux: Lots of best practices including RTK - MobX: Mutable states - React-Tracked: Pure React state and context
Reply Retweet Like
Daishi Kato Dec 13
Actually, my order of options is a bit different. Option1: Use single Context as you like Option2: Use multiple Contexts. Option3: Use Redux, MobX or React Tracked.
Reply Retweet Like
Daishi Kato Dec 13
> Option 1: Don’t worry at all. Keep on Context’n like you do. If somebody is interested in eliminating re-renders without changing the way you use context, please check out React Tracked.
Reply Retweet Like
Daishi Kato Dec 12
Replying to @rChaser53
すみません、過去の発表とかぶるかなと思って、あまり中身の話ができませんでした。 や、 などをご参照いただければと。考察は、 とか。考察になっていないかもですが。
Reply Retweet Like
Daishi Kato Dec 11
Likewise, I add basic examples in README of react-hooks-async.
Reply Retweet Like
Daishi Kato Dec 11
Replying to @JimTheDev
Updated the example. That (importing parent) was the issue for the infinite loop. Fixed. Was my bad.
Reply Retweet Like