Skip to content

Commit f7e058c

Browse files
committed
deleting node modules and pe.lock.json because of errors
1 parent e70bdf9 commit f7e058c

20 files changed

+1888
-38986
lines changed

README.html

Lines changed: 1415 additions & 502 deletions
Large diffs are not rendered by default.

interview_answers.md

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,36 @@
11
# Interview Answers
2-
Be prepared to demonstrate your understanding of this week's concepts by answering questions on the following topics. These will not be counted as a part of your sprint score but will be helpful for preparing you for your endorsement interview, and enhancing overall understanding.
32

3+
Be prepared to demonstrate your understanding of this week's concepts by answering questions on the following topics. These will not be counted as a part of your sprint score but will be helpful for preparing you for your endorsement interview, and enhancing overall understanding.
44

55
---
6-
---
7-
86

7+
---
98

109
1. What problem does the context API help solve?
1110

1211
> Sometimes for smaller applications with simple but deeply nested components... redux is overkill. In these situations you don't nescissarily need a library to deal with state managment the way you would with a larger application. In these situations it is convinient not to add unessicary complexity that comes with the teritroy of using REDUX.
1312
14-
15-
16-
1713
---
1814

19-
2. In your own words, describe `actions`, `reducers` and the `store` and their role in Redux.
15+
2. In your own words, describe `actions`, `reducers` and the `store` and their role in Redux.
2016
What does each piece do? Why is the store known as a 'single source of truth' in a redux application?
2117

22-
- actions: Actions are plain JavaScript object that must have a type attribute to indicate the type of action performed. They provide information (called a payload) to the Redux store. Action creators send actions via the dispatch function to reducers.
23-
18+
- actions: Actions are plain JavaScript object that must have a type attribute to indicate the type of action performed. They provide information (called a payload) to the Redux store. Action creators send actions via the dispatch function to reducers.
2419

2520
- reducers: A pure function that takes in state and action and creates a new state based on the action.type. A reducer is a set of options that can be preformed on the current state to get to the updated state and a central location where the state is held until an action type matces a specific case described in the reducer... this case will result in the exicution of a set of instructions on how to modify the state based on the nature of the action and payload recieved from the action object.
2621

27-
28-
- store: The Redux store an object that represents the current state of the application. Whenever the store is updated, it will update the React components subscribed to it. It is updated by either spreadig the previous state or using object.assign() but importantly an update in state must not mutate the store object contaning the previous state.The store is used for storing, reading, and updating state.
22+
- store: The Redux store an object that represents the current state of the application. Whenever the store is updated, it will update the React components subscribed to it. It is updated by either spreadig the previous state or using object.assign() but importantly an update in state must not mutate the store object contaning the previous state.The store is used for storing, reading, and updating state.
2923

3024
---
3125

3226
1. What does `redux-thunk` allow us to do? How does it change our `action-creators`?
3327

34-
35-
>Redux Thunk is used when communicating asynchronously with an external API to retrieve or save data ...in which case it serves as middlewareenabling us to call action creators that return a function instead of an action object. Said function receives the store’s dispatch method, which is in turn used to dispatch regular synchronous actions inside the function’s body once the asynchronous operations have resolved.
36-
37-
28+
> Redux Thunk is used when communicating asynchronously with an external API to retrieve or save data ...in which case it serves as middlewareenabling us to call action creators that return a function instead of an action object. Said function receives the store’s dispatch method, which is in turn used to dispatch regular synchronous actions inside the function’s body once the asynchronous operations have resolved.
3829
3930
---
4031

4132
4. What is your favorite state management system you've learned and this sprint? Please explain why!
4233

4334
> I think the most important takeaway from this week was not to play favorites ... because for the range of apps you might end up developing there is no one size fit's all solution. My favorite state managment system depends wholly on the use case.
4435
45-
46-
47-
48-
49-
5036
---

notes/create-store.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,11 @@ Creates a Redux [store](https://redux.js.org/api/store) that holds the complete
66

77
([_`Store`_](https://redux.js.org/api/store)): An object that holds the complete state of your app. The only way to change its state is by [dispatching actions](https://redux.js.org/api/store#dispatchaction). You may also [subscribe](https://redux.js.org/api/store#subscribelistener) to the changes to its state to update the UI.
88

9-
* Don't create more than one store in an application! Instead, use [`combineReducers`](https://redux.js.org/api/combinereducers) to create a single root reducer out of many.
10-
11-
* Redux state is normally plain JS objects and arrays.
12-
13-
* If your state is a plain object, make sure you never mutate it! For example, instead of returning something like `Object.assign(state, newData)` from your reducers, return `Object.assign({}, state, newData)`. This way you don't override the previous `state`. You can also write `return { ...state, ...newData }` if you enable the [object spread operator proposal](https://redux.js.org/recipes/using-object-spread-operator).
14-
15-
* For universal apps that run on the server, create a store instance with every request so that they are isolated. Dispatch a few data fetching actions to a store instance and wait for them to complete before rendering the app on the server.
16-
17-
* When a store is created, Redux dispatches a dummy action to your reducer to populate the store with the initial state. You are not meant to handle the dummy action directly. Just remember that your reducer should return some kind of initial state if the state given to it as the first argument is `undefined`, and you're all set.
18-
19-
* To apply multiple store enhancers, you may use [`compose()`](https://redux.js.org/api/compose).
20-
9+
- Don't create more than one store in an application! Instead, use [`combineReducers`](https://redux.js.org/api/combinereducers) to create a single root reducer out of many.
10+
- Redux state is normally plain JS objects and arrays.
11+
- If your state is a plain object, make sure you never mutate it! For example, instead of returning something like `Object.assign(state, newData)` from your reducers, return `Object.assign({}, state, newData)`. This way you don't override the previous `state`. You can also write `return { ...state, ...newData }` if you enable the [object spread operator proposal](https://redux.js.org/recipes/using-object-spread-operator).
12+
- For universal apps that run on the server, create a store instance with every request so that they are isolated. Dispatch a few data fetching actions to a store instance and wait for them to complete before rendering the app on the server.
13+
- When a store is created, Redux dispatches a dummy action to your reducer to populate the store with the initial state. You are not meant to handle the dummy action directly. Just remember that your reducer should return some kind of initial state if the state given to it as the first argument is `undefined`, and you're all set.
14+
- To apply multiple store enhancers, you may use [`compose()`](https://redux.js.org/api/compose).
2115

2216
[Source](https://redux.js.org/api/createstore)

notes/reducers.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ If we were in math class, we could say:
1919
In terms of an actual reducer function, that looks like this:
2020

2121
const contactReducer = (state = initialState, action) => {
22-
22+
2323
}
2424

2525
Where do we get that initial state and action? Those are things we define.
@@ -108,15 +108,15 @@ That means that a typical reducer will look like this:
108108
}
109109
case 'UPDATE_CONTACT':
110110
return {
111-
111+
112112
}
113113
case 'DELETE_CONTACT':
114114
return {
115-
115+
116116
}
117117
case 'EMPTY_CONTACT_LIST':
118118
return {
119-
119+
120120
}
121121
default:
122122
return state
@@ -144,5 +144,4 @@ Want to give it a try? You can extend the reducer function to allow the user to
144144

145145
Understanding the role that reducers play in Redux should give you a better understanding of what happens underneath the hood. If you are interested in reading more about using reducers in Redux, it’s worth checking out the [official documentation](https://redux.js.org/basics/reducers).
146146

147-
148147
[Source](https://css-tricks.com/understanding-how-reducers-are-used-in-redux/)

0 commit comments

Comments
 (0)