reading-notes

this repo will contain my reading during the course .

View project on GitHub

Read: Class 36 : Application State with Redux

img

Review, Research, and Discussion

What are the advantages of storing tokens in “Cookies” vs “Local Storage”

  • Cookies are automatically saved, sent and removed by the browser. The frontend developer does not have to worry about implementing this part, nor is there any scope of a mistake from the frontend side. This is not true for localstorage

  • for API calls to the server, they will only get the session tokens if they are using cookies – localstorage will not work”

Explain 3rd party cookies :

How do pixel tags work?

  • It’s a 1×1-pixel graphic used for tracking user behavior, site conversions, web traffic, and other metrics at a site’s server level. In other words, it is a tiny pixel-sized image, usually hidden, embedded in everything, from banner ads to emails.

Document the following Vocabulary Terms

  • access control: Access control is a security technique that regulates who or what can view or use resources in a computing environment.

  • conditional rendering: Conditional rendering is a term to describe the ability to render different user interface (UI) markup if a condition is true or false. In React, it allows us to render different elements or components based on a condition

Preparation Materials

Redux

  • Redux is a pattern and library for managing and updating application state, using events called “actions”

  • Redux is a predictable state container for JavaScript apps.

  • It helps you write applications that behave consistently…

  • Redux provides a solid, stable, and mature solution to managing state in your React application

  • transform your application from a total mess of confusing and scattered state, into a delightfully organized, easy to understand modern JavaScript powerhouse.

One application state object managed by one store

Why use Redux?

  • Redux allows you to manage your app’s state in a single place and keep changes in your app more predictable and traceable. It makes it easier to reason about changes occurring in your app.

how to use Redux in react

  1. create store as we create context
  2. pass store and context to provider
  3. imported as context exactly

How Redux works

  • There is a central store that holds the entire state of the application. Each component can access the stored state without having to send down props from one component to another.

  • There are three building parts: actions, store, and reducers

An action creator

is a function that creates and returns an action object. We typically use these so we don’t have to write the action object by hand every time:

A reducer

is a function that receives the current state and an action object, decides how to update the state if necessary, and | returns the new state: (state, action) => newState.

Resources