You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: React/controlled-unContolled-Component.md
+2
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,8 @@ class ControlledForm extends Component {
32
32
}
33
33
```
34
34
35
+
#### A user types into the input box → onChange is triggered invoking the updateUsername function. → the state of our component is set to a new value → React re-renders the virtual DOM → React Diffs the change → Real DOM is updated.
36
+
35
37
An uncontrolled component is where your form data is handled by the DOM, instead of inside your React component.
Copy file name to clipboardExpand all lines: Redux/compose.md
+52-1
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,36 @@
1
+
Compose is used when you want to pass multiple store enhancers to the store. Store enhancers are higher order functions that add some extra functionality to the store. The only store enhancer which is supplied with Redux by default is applyMiddleware however many other are available.
2
+
3
+
Store Enhancers are Higher Order Functions
4
+
5
+
What are higher order functions? Paraphrased from the Haskell docs:
6
+
7
+
Higher order functions can take functions as parameters and return functions as return values. A function that does either of those is called a higher order function
8
+
9
+
From the Redux docs:
10
+
11
+
All compose does is let you write deeply nested function transformations without the rightward drift of the code. Don’t give it too much credit!
12
+
13
+
From the Redux docs if we don't use compose we would have
Copy file name to clipboardExpand all lines: Redux/redux-thunk-what-is-thunk-in-programming.md
+1-2
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
## 1> What are Thunks?
2
2
3
-
The precise definition of a “thunk” varies across contexts. Generally though, thunks are a functional programming technique used to delay computation. Instead of performing some work now, you produce a function body or unevaluated expression (the “thunk”) which can optionally be used to perform the work later. Compare:
3
+
Thunks are a functional programming technique used to delay computation. Instead of performing some work now, you produce a function body or unevaluated expression (the “thunk”) which can optionally be used to perform the work later. Compare:
2> In computer programming, a thunk is a subroutine used to inject an additional calculation into another subroutine. Thunks are primarily used to delay a calculation until its result is needed, or to insert operations at the beginning or end of the other subroutine. They have a variety of other applications in compiler code generation and modular programming.
0 commit comments