reading-notes

Putting it all together

React Docs - Thinking in React

What is the single responsibility principle and how does it apply to components?

The Single Responsibility Principle (SRP) is a design principle in software engineering that states that every module, class, or function should have a single responsibility or reason to change. In other words, a component should only have one reason to change, and that is to fulfill its responsibility.

What does it mean to build a ‘static’ version of your application?

Building a static version of an application refers to generating a version of the application where the content is fixed or static, meaning that the data does not change dynamically in response to user input or other events.

Once you have a static application, what do you need to add?

Client-side Javascript, API integrations, forms and user input

What are the three questions you can ask to determine if something is state?

Does it change over time? Is it affected by outside influences? Does it need to be remembered?

How can you identify where state needs to live?

Identify the scope of the state, think about the data flow, consider the application architecture, prioritize simplicity and maintainability, and test different approaches

Higher-Order Functions

What is a “higher-order function”?

a higher-order function is a function that takes another function as an argument, or returns a function as its result. It is a function that operates on other functions, either by taking them as arguments or by returning them as values.

Explain how either map or reduce operates, with regards to higher-order functions

Map is a higher-order function that takes a function as an argument and applies it to each element of an array, returning a new array of transformed values.

Reduce is a higher-order function that takes a function as an argument and applies it to each element of an array, reducing the array to a single value.

Sources

## Things I want to know more about