8) Master Project: Redux 1 Flashcards
Redux allows react state to be more ___
scalable
Redux is a library that makes state management …
easier
list the 3 principles of redux state management?
- Single source of truth
- State is read only
- Changes using pure functions
List the 4 steps in the Redux flow. what is the name for this kind of pattern?
- Action
- Root Reducer
- Store
- DOM changes
Flux Pattern
redux === ___
this.state
T/F: You can use redux with this.state?
T
What is middleware?
a piece of code that gets the action before it reaches the reducer
what does the redux logger middleware do?
logs out actions that get fired, and what the sate looks like before and after these actions.
what component from “react-redux” allows every component in the application to have access to the store redux? where does this component go?
provider; parent of everything
wraps around the entire application in index.js, so all components have access to the state.
T/F: every action triggers every reducer?
T
what is the connect function?
a higher order component that lets us modify our component to have access to redux
What is a selector in redux?
a slice of state data
what does the library “reselect” allow us to do?
create selectors in a way that they are cached and don’t trigger component re-rending if the state does not change
what are the two types of selectors?
- *input selector:** a function that gets the whole state and returns a slice of it
- *memoized selector:** when we use the createSelector function
list the 6 falsy of javascript
- 0
- false
- null
- undefined
- NaN
- ””
when do you not put the exact argument in a <route> component?</route>
when their may be subsequent slashes indicating sub categories of that page
ex: shop/hats
what is the overarching rule of righting Extensible Code?
keep the code structure as simple as possible
what is the importance of using the alt attribute in an image tag?
the value of that property will be read by screen readers for the convenience of those with impaired vision.