-
-
Save glebec/51a4cecabf0bb7d15f8fe8f5946263b4 to your computer and use it in GitHub Desktop.
Revisions
-
glebec revised this gist
Jul 10, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -43,8 +43,8 @@ The instructor will demo the use of thunks in a sample application based upon th - [LearnDot Workshop](https://learn.fullstackacademy.com/workshop/5d1f8982fa4db900045d3b1f/landing) contains the following: - Lab: writing Redux middleware - Lab: using thunk middleware in a small app ## Solution(s) - Included as inline text and images of text in the LearnDot workshop -
glebec revised this gist
Jul 9, 2019 . 1 changed file with 14 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,23 +25,26 @@ By completing the workshop, students should be able to: ## Prework ### Pre-reading - [LearnDot Workshop (several pages)](https://learn.fullstackacademy.com/workshop/5d1f8982fa4db900045d3b1f/content/5d20bc3baab7cc0004c442b0/text) - [Article: What is a Thunk - 5 mins](https://daveceddia.com/what-is-a-thunk/) - [Gabriel Lebec's Medium articleL: Thunks in Redux - 11 mins](https://medium.com/fullstack-academy/thunks-in-redux-the-basics-85e538a3fe60) ## In-class ### Instructor Demo The instructor will demo the use of thunks in a sample application based upon the following codebase and accompanying video lecture: - [thunk codebase](https://github.com/FullstackAcademy/1806-GH-NY/tree/master/01-junior/24-react-redux/movie-thunk) - [thunk video demonstration](https://www.youtube.com/watch?v=8wGDsZoPV3Y) ### Exercise - [LearnDot Workshop](https://learn.fullstackacademy.com/workshop/5d1f8982fa4db900045d3b1f/landing) contains the following: - Lab: writing Redux middleware - Lab: implementing thunk middleware ## Solution(s) - TBD -
glebec revised this gist
Jul 9, 2019 . 1 changed file with 16 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,17 +5,22 @@ Thunks are a popular way to avoid directly causing side effects in our actions, ## Objectives ### High-Level - Students will understand the need to isolate side-effects to a particular stage of the redux cycle. - Students will be able to integrate the `redux-thunk` libary into a redux application and use it to make AJAX requests. ### Low-Level By completing the workshop, students should be able to: - explain what _middleware_ are in the context of Redux - write an example Redux middleware (logger) - explain what a _thunk_ is, and how it "relocates" effects - install and configure the `redux-thunk` library into an existing Redux app - write "thunked" action creators (or "thunk creators," if you prefer) - refactor stateful React components use thunked action creators instead - explain the advantage of using thunks in a React-Redux app ## Prework -
glebec revised this gist
Jul 9, 2019 . 1 changed file with 13 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,9 +3,19 @@ ## Needs Statement Thunks are a popular way to avoid directly causing side effects in our actions, action creators, or components, thus allowing us to keep the rest of our application pure (easier to test, reason about, re-use). Thunks are the simplest way to deal with AJAX requests in a redux application. ## Objectives - High-level - Students will understand the need to isolate side-effects to a particular stage of the redux cycle. - Students will be able to integrate the `redux-thunk` libary into a redux application and use it to make AJAX requests. - Low-level: by completing the workshop, students should be able to: - explain what _middleware_ are in the context of Redux - write an example Redux middleware (logger) - explain what a _thunk_ is, and how it "relocates" effects - install and configure the `redux-thunk` library into an existing Redux app - write "thunked" action creators (or "thunk creators," if you prefer) - refactor stateful React components use thunked action creators instead - explain the advantage of using thunks in a React-Redux app ## Prework -
johnptmcdonald revised this gist
Apr 12, 2019 . 1 changed file with 4 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,14 +13,13 @@ Students will be able to integrate the `redux-thunk` libary into a redux applica - [What is a thunk - 5 mins](https://daveceddia.com/what-is-a-thunk/) - [Gabriel Lebec's Medium article - 11 mins](https://medium.com/fullstack-academy/thunks-in-redux-the-basics-85e538a3fe60) ## In-class ### Tutorial It seems that students have not yet covered redux middleware in any previous module, which is a prerequisite for learning about thunks. - [Learndot: Lab - Redux Middleware](https://learn.fullstackacademy.com/workshop/5a9058a9ba75f300049f97c2/landing) - [starting point](https://github.com/FullstackAcademy/Lab.ReduxBank/tree/solution) ### Instructor Demo The instructor will demo the use of thunks in a sample application based upon the following codebase and accompanying video lecture: - [thunk codebase](https://github.com/FullstackAcademy/1806-GH-NY/tree/master/01-junior/24-react-redux/movie-thunk) -
johnptmcdonald revised this gist
Apr 9, 2019 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,9 +15,9 @@ Students will be able to integrate the `redux-thunk` libary into a redux applica ### Pre-tutorial It seems that students have not yet covered redux middleware in any previous module, which should be a prerequisite for learning about thunks. If this is correct, students should cover this in the pre-tutorial: - [Learndot: Lab - Redux Middleware](https://learn.fullstackacademy.com/workshop/5a9058a9ba75f300049f97c2/landing) - [starting point](https://github.com/FullstackAcademy/Lab.ReduxBank/tree/solution) ## In-class -
johnptmcdonald revised this gist
Apr 9, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,7 +17,7 @@ Students will be able to integrate the `redux-thunk` libary into a redux applica - It seems that students have not yet covered redux middleware in any previous module, which should be a prerequisite for learning about thunks. If this is correct, students should cover this in the pre-tutorial: - [Learndot: Lab - Redux Middleware](https://learn.fullstackacademy.com/workshop/5a9058a9ba75f300049f97c2/landing) - [starting point](https://github.com/FullstackAcademy/Lab.ReduxBank/tree/solution) ## In-class -
johnptmcdonald created this gist
Apr 9, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ # Thunks ## Needs Statement Thunks are a popular way to avoid directly causing side effects in our actions, action creators, or components, thus allowing us to keep the rest of our application pure (easier to test, reason about, re-use). Thunks are the simplest way to deal with AJAX requests in a redux application. ## Objective Students will understand the need to isolate side-effects to a particular stage of the redux cycle. Students will be able to integrate the `redux-thunk` libary into a redux application and use it to make AJAX requests. ## Prework ### Pre-reading - [What is a thunk - 5 mins](https://daveceddia.com/what-is-a-thunk/) - [Gabriel Lebec's Medium article - 11 mins](https://medium.com/fullstack-academy/thunks-in-redux-the-basics-85e538a3fe60) ### Pre-tutorial - It seems that students have not yet covered redux middleware in any previous module, which should be a prerequisite for learning about thunks. If this is correct, students should cover this in the pre-tutorial: - [Learndot: Lab - Redux Middleware](https://learn.fullstackacademy.com/workshop/5a9058a9ba75f300049f97c2/landing) - [starting point](https://github.com/FullstackAcademy/Lab.ReduxBank/tree/solution) ## In-class ### Instructor Demo The instructor will demo the use of thunks in a sample application based upon the following codebase and accompanying video lecture: - [thunk codebase](https://github.com/FullstackAcademy/1806-GH-NY/tree/master/01-junior/24-react-redux/movie-thunk) - [thunk video demonstration](https://www.youtube.com/watch?v=8wGDsZoPV3Y) ### Tutorial - [Learndot: Lab - Thunk Middleware](https://learn.fullstackacademy.com/workshop/5ab17c6313abf90004cc71f7/landing) - [starting point](https://github.com/FullstackAcademy/Lab.Thunk) - [solution](https://github.com/FullstackAcademy/Lab.Thunk/tree/solution)