W7D1 Flashcards
What is lodash?
It is JS utility library and npm-package that provides many useful helper functions for solving common problems.
What is lodash merge?
It is a quick and effective way to deep dup an object
What is lodash union?
It creates an array of unique values in insertion order from 2 given arrays
What is flux?
Flux is a front-end application pattern developed to used with React. It provides a unidirectional data flow, which affords more predictability.
What is an Action
It is a simple object that at minimum maintains a ‘type’. It begins a flows of data in Flux.
What is an Action type?
It indicates the type of change to be performed on the application’s state.
Dispatcher
is a mechanism for distributing actions to a Flux application store and a pseudo bank/library of actions.
Store
It represents the entire state of the application. Also responsible for updating the state of the application whenever it receives an action.
View
It is responsible for rendering the user interface and it can create actions.
What is the flow of flux?
Store will check the dispatcher for any actions and change the state. It will than pass the changed state to the view. If the view has an action, it will pass that action to the dispatcher and the store will check the dispatcher again.
What is redux?
A node package that facilitates a particular implementation of Flux.
What are 3 principles of Redux?
- The entire state of App is stored in single JS object, which is stored in a single store.
- The only way to change the state of the applicatin is to dispatch an action.
- Pure Functions aka Reducers are the only ones to change state.
What does a reducer receive? What does it return?
Receives Current State and an action and return the new state
What is the reducer first initialized with?
An undefined state
What is Reducer Composition?
It is the concept of splitting up reducers into multiple reducers handling separate, independent slices of the global state.