Logo
    Search

    redux

    Explore "redux" with insightful episodes like "The Ultimate React State Management Handbook", "React State Round Up", "State In React" and "All About Redux && Cookies vs JWT" from podcasts like ""Programming Tech Brief By HackerNoon", "Syntax - Tasty Web Development Treats", "Syntax - Tasty Web Development Treats" and "Syntax - Tasty Web Development Treats"" and more!

    Episodes (4)

    The Ultimate React State Management Handbook

    The Ultimate React State Management Handbook

    This story was originally published on HackerNoon at: https://hackernoon.com/the-ultimate-react-state-management-handbook.
    Enhance your React skills with 'The Ultimate React State Management Handbook.
    Check more stories related to programming at: https://hackernoon.com/c/programming. You can also check exclusive content about #react-state-management, #redux, #reactjs, #react, #react-tutorial, #react-hook, #web-development, #software-engineering, and more.

    This story was written by: @theankurtyagi. Learn more about this writer by checking @theankurtyagi's about page, and for more stories, please visit hackernoon.com.

    A comprehensive guide to React State Management, covering the basics to advanced techniques. Learn to manage and update states using useState and useReducer hooks, explore state management with Context API and Redux Toolkit, and discover how to store states in URLs. Essential for React developers seeking to master state management.

    React State Round Up

    React State Round Up

    In this episode of Syntax, Scott and Wes talk about React State libraries, should you use them, pros, cons, and more!

    Sanity - Sponsor

    Sanity.io is a real-time headless CMS with a fully customizable Content Studio built in React. Get a Sanity powered site up and running in minutes at sanity.io/create. Get an awesome supercharged free developer plan on sanity.io/syntax.

    Sentry - Sponsor

    If you want to know what’s happening with your errors, track them with Sentry. Sentry is open-source error tracking that helps developers monitor and fix crashes in real time. Cut your time on error resolution from five hours to five minutes. It works with any language and integrates with dozens of other services. Syntax listeners can get two months for free by visiting Sentry.io and using the coupon code “tastytreat”.

    Show Notes

    01:24 - Context

    • Have we used?
      • Scott: Yes
      • Wes: Yes
    • Pros
      • Built into React
      • As simple or complex as you want
    • Cons
      • Takes effort to optimize
      • Takes effort to plan and organize aka can get out of hand quickly

    08:49 - Redux

    • Have we used?
      • Scott: Yes
      • Wes: Yes
    • Pros
      • Huge user base
      • Legacy of growth and improvements
      • Modern API
      • Even though it’s hard to learn, it has a clear “how to build with it” path
      • Dev tools
    • Cons
      • Complex
      • Thing that calls a thing that calls a thing that calls a thing
      • Confusion around what additional packages are needed, e.g. ducks, saga, whatever

    17:08 - XState

    • Have we used?
      • Scott: Yes
      • Wes: No
    • Pros
    • Cons
      • Knowledge overhead - having to understand state machines
      • Complex syntax

    23:26 - Zustand

    • Have we used?
      • Scott: Yes
      • Wes: No
    • Pros
      • Fast, scalable, easy to use
      • Simpler
      • No context providers
    • Cons
      • Smaller community 2.6k stars on Github
      • Can inform components transiently (without causing render)

    27:04 - Apollo Client

    • Have we used?
      • Scott: Yes
      • Wes: Yes
    • Pros
      • Fits in well with your GraphQL API
      • Dev tools
    • Cons
      • Complex, large syntax for simple operations
      • Dev tools
      • SSR story is really complex. It’s hard because they aren’t also the framework.

    31:35 - RXJS

    • Have we used?
      • Scott: No
      • Wes: No
    • Observable based

    33:02 - React Query

    • Have we used?
      • Scott: No
      • Wes:
    • Pros
      • Fast growing community
      • Awesome dev tools
    • Cons
      • Not sure if this can be used for application state or just data

    35:37 - Recoil

    • Have we used?
      • Scott: Yes
      • Wes: No
    • Pros
      • Very good for complex, splintered state needs
    • Cons
      • Overly complex for most use cases

    38:34 - MobX

    • Have we used?
      • Scott: No
      • Wes: No
    • Pros
      • Big community
      • Not just React
      • Powerful
      • Observable capabilities
    • Cons
      • Uses decorators, but doesn’t have to?

    43:15 - Easy Peasy

    • Have we used?
      • Scott: No
      • Wes: No
    • Pros
      • Simple API (easy peasy)
      • Redux dev tools supported

    45:06 - Meteor ReactiveDict / ReactiveVar

    • Have we used?
      • Scott: Yes
      • Wes: No
    • Pros
      • Very simple
      • Get, set
      • Is Reactive
    • Cons
      • Lock-in to Meteor

    46:19 - Final Thoughts On State

    • Wes: Go for simpler solutions
    • Scott: I think application state should be separate from application data, but maybe that’s because there isn’t a solution that does both how I want

    Links

    ××× SIIIIICK ××× PIIIICKS ×××

    Shameless Plugs

    Tweet us your tasty treats!

    State In React

    State In React

    In this episode of Syntax, Scott and Wes talk about state in React: local state, global state, UI state, data state, caching, API data and more!

    LogRocket - Sponsor

    LogRocket lets you replay what users do on your site, helping you reproduce bugs and fix issues faster. It’s an exception tracker, a session re-player and a performance monitor. Get 14 days free at logrocket.com/syntax.

    Freshbooks - Sponsor

    Get a 30 day free trial of Freshbooks at freshbooks.com/syntax and put SYNTAX in the “How did you hear about us?” section.

    Show Notes

    3:38 - What is state?

    4:58 - What kind of things are kept in state?

    • Data
      • Temporary client side data
        • From forms, button clicks, etc.
      • Cached server data
      • Data from API
    • UI status
      • AKA isModalOpen
      • isToggled

    12:48 - Global state vs. Local state

    • Ask yourself: does the data need to be accessed outside this component?
      • If data does need to be accessed a little higher, you can simply move where that state lives. React calls this “lifting state”.
    • Do you count Apollo API calls as global state?

    21:15 - Managing Local state

    • useState, setState
    • Passing state & update functions down
    • State machines

    31:12 - Approaches to Global state

    • Redux

      • Complicated, hard to learn
      • Very useful, organized and structured
      • Actions, reducers and more
      • Time traveling do to nature of store
      • Immutability
      • Tons of Redux based hooks libs
    • Mobx

      • Based on Observables
        • An Observable is like a Stream and allows to pass zero or more events where the callback is called for each event. Often Observable is preferred over Promise because it provides the features of Promise and more.
    • Context

      • Functions just work and update global state.
      • Downside is there are no fancy tools
    • Apollo

      • Apollo quires for data in global cache
      • Apollo client for global UI state
        • Not quite there, isn’t super elegant

    Links

    ××× SIIIIICK ××× PIIIICKS ×××

    Shameless Plugs

    Tweet us your tasty treats!

    All About Redux && Cookies vs JWT

    All About Redux && Cookies vs JWT

    Dev Lifts — Sponsor

    Dev Lifts will create a personal training plan tailored to your 2018 health and fitness goals. Use the code SYNTAX for $50 off.

    Join with a friend and we'll make you a Buddy Plan that you can do together (nutrition will still be tailored on a per-individual basis, but workouts will be something you can both do together)! Plus, use the coupon code below and you'll both get $100 off.

    Enter each other's email address as the coupon code and your discount will be applied to your invoices (invoices are sent manually currently, so I'll apply the discount for you both once you've both signed up). Valid thru January 31, 2018.

    The Show Notes!

    01:00

    06:00

    • Modifying Your State
    • Immutability

    07:15

    • Actions + Actions Creators
    • Dispatching

    09:00

    • Reducers

    14:00

    18:30

    • What is the difference between Cookies and JWT?

    Tweet us your tasty treats!