Upgrade to Pro — share decks privately, control downloads, hide ads and more …

You might not need redux

You might not need redux

Maxime Thirouin

May 23, 2018
Tweet

More Decks by Maxime Thirouin

Other Decks in Technology

Transcript

  1. @MoOx - behave consistently - run in different environments (client,

    server, and native) - are easy to test 4 Redux helps you write applications that
  2. @MoOx - live code editing (hot reloading) - time traveling

    debugger. 5 Redux provides a
 great developer experience
  3. @MoOx - persist state (local storage) & boot from it

    (CSR & SSR) - serialize actions & save/reuse those - easy undo/redo / time traveling - share business logic between apps 6 Redux allows you to
  4. @MoOx 8 @MoOx Redux is nice, makes app structuring foreseeable,

    forces developers to think about their model
  5. @MoOx If you abuse Redux,
 all your components might end

    up being connect()ed 15 Is this what you want?
  6. @MoOx Be careful not to use redux for everything 16

    https://github.com/final-form/react-final-form By the guy that did redux-form, but later
  7. @MoOx setState() and passing props might be enough 24 (if

    your store is at the top of your app, you can pass things down)
  8. @MoOx “Should you do this to your stateful components? Probably

    not. Not unless you have a plan to benefit from this additional indirection” 41 https://medium.com/@dan_abramov/you-might-not-need-redux-be46360cf367
  9. @MoOx What redux does, ReasonReact and Elm do 42 Actions

    are types, reducers are functions,
 state is immutable, but at the language level
  10. @MoOx - Does my app need this? - Does my

    team need this? - Does my product need this? @MoOx 45 Before adding Redux (and other fancy things)