News for hackers. Stuff that matters.
Re:React best practices by merb on Wednesday May 05, 2021 @05:20PM (#27055980)
that was the easy part. now what do you do if two independent parts of the ui need to do something if the responseData gets updated. you either bubble downards or you need a store.
Re:React best practices by bluedevil2k on Thursday May 06, 2021 @08:01AM (#27061949)
Yes, you'd probably use Redux and wrap that API call in a dispatch(). I try to stick to the design pattern of "get a response from the API call if you need the data in that function, otherwise use Redux". I've created a library that really helps with this if you're interested - https://github.com/bluedevil2k/ruffle
Re:React best practices by merb on Thursday May 06, 2021 @08:44AM (#27062357)
yeah your library looks good, unfortunatly we are using typescript and are a dotnet shop and we have our own stuff to create the store and built that into reactjs.net.