3forges / juste-un-curieux-twitch-overlay

The twitch overlay for Justin Curieux
https://juste-un-curieux-twitch-overlay.pages.dev/
0 stars 1 forks source link

react state and async api calls #7

Open Jean-Baptiste-Lasselle opened 9 months ago

Jean-Baptiste-Lasselle commented 9 months ago
// instead of 
setCounter(counter + 1)
// I can

setCounter( (cuurentCount) => { return (currentCount +1) } )

Now that will work for sure for aync api calls, but how to do that with ttwitch.on('message' is a different story

Note I also realized its not obvious at al to use rxjs with redux toolkit (aka redux rtk, rtk queries)