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

BetterMe: ReduxCore library. Intro

BetterMe: ReduxCore library. Intro

Maksym Husar

August 11, 2021
Tweet

Other Decks in Programming

Transcript

  1. Fundamental principles • Single source of truth The global state

    of your application is stored in an object tree within a single store. • State is read-only The only way to change the state is to emit an action, an object describing what happened. • Changes are made with pure functions To specify how the state tree is transformed by actions, you write pure reducers. https://redux.js.org/understanding/thinking-in-redux/three-principles
  2. Redux Application Data Flow One-way data flow: • State describes

    the condition of the app at a specific point in time • The UI is rendered based on that state • When something happens (such as a user clicking a button), the state is updated based on what occurred • The UI re-renders based on the new state
  3. Dispatch & Observer * We use CommandWith<State> type instead of

    Observer typealias for more flexibility
  4. Main parts of the App • State & SubStates •

    Store setup • Middlewares • Presentation Layer
  5. Main parts of the App • State & SubStates •

    Store setup • Middlewares • Presentation Layer
  6. Main parts of the App • State & SubStates •

    Store setup • Middlewares • Presentation Layer
  7. Main parts of the App • State & SubStates •

    Store setup • Middlewares • Presentation Layer
  8. Q&A