dopey_kun,

I think it's the first time I'ved used a reducer in React in like 3 years (last time was when I used Redux). I always avoided them because of how boilerplate-y they were, but honestly, they're awesome considering the alternative of a whole bunch of useState and useEffect spaghetti.

anianimalsmoe,
@anianimalsmoe@sakurajima.moe avatar

@dopey_kun For a game, I'd definitely just go full Redux, because of the convenience of persistence and tab-syncing. It's just a little annoying to get both working together.

dopey_kun,

deleted_by_author

  • Loading...
  • anianimalsmoe,
    @anianimalsmoe@sakurajima.moe avatar

    @dopey_kun A player may accidentally have the game already open in multiple tabs, and expect the game to be exactly the same in each one.

    If you just use localstorage, the save state may accidentally get overwritten by old state from an old tab. redux-state-sync forces old tabs to update.

    Of course, it might cause other issues if you don't do it carefully too, but it should be fine if the entire UI runs on redux

  • All
  • Subscribed
  • Moderated
  • Favorites
  • reactjs
  • DreamBathrooms
  • mdbf
  • ngwrru68w68
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • osvaldo12
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • InstantRegret
  • tacticalgear
  • anitta
  • ethstaker
  • provamag3
  • cisconetworking
  • tester
  • GTA5RPClips
  • cubers
  • everett
  • modclub
  • megavids
  • normalnudes
  • Leos
  • JUstTest
  • lostlight
  • All magazines