diff --git a/step1-06/demo/README.md b/step1-06/demo/README.md index 9adfba5..21cc2ed 100644 --- a/step1-06/demo/README.md +++ b/step1-06/demo/README.md @@ -122,4 +122,4 @@ With those two pieces in place, we can update our uncontrolled input to being co ``` -> If you have React Dev Tools installed, open them up and take a look at labelInput as we type in the input. +> If you have React Dev Tools installed, open them up and take a look at `labelInput` as we type in the input. diff --git a/step2-01/demo/README.md b/step2-01/demo/README.md index f5e79de..73edc12 100644 --- a/step2-01/demo/README.md +++ b/step2-01/demo/README.md @@ -30,13 +30,13 @@ The most important ones to know about are: ## TypeScript Types -Refer to [`demo/src`](./demo/src) for examples of some of the types available in TS that benefit a React developer. +Refer to [`demo/src/types`](./src/types/index.ts) for examples of some of the types available in TS that benefit a React developer. ## Spread Operator The spread operator `...` provides a quick way to clone and concatenate objects and arrays. This syntax is seen a lot inside React props and Redux reducers. -With objects: +With **objects**: ```ts // Shallow copy an object @@ -52,7 +52,7 @@ const cloned2 = { ...obj1, ...obj2, key: value }; const overridden = { ...object, [key + '-suffix']: value }; ``` -With arrays: +With **arrays**: ```ts const copy1 = [...arr]; @@ -107,7 +107,7 @@ const [foo, ...bar] = arr; ## Promise -A promise is an object representing work that will be completed later, asynchronously. Promises are chainable, which helps with writing maintainable async code. (Typically, legacy async code uses callbacks to let the caller have control over what to do after the task has been completed, which becomes very hard to read.) +A promise is an object representing work that will be completed later, asynchronously. Promises are chainable, which helps with writing maintainable async code. (Typically, legacy async code uses callbacks to let the caller have control over what to do after the task has been completed, which becomes [very hard to read](http://callbackhell.com/).) ```ts const aPromise = new Promise((resolve, reject) => { @@ -141,7 +141,7 @@ aPromise ## Async / Await -This syntax is inspired heavily by C#'s async / await syntax. An async function is written like this: +**Async / Await** is a language-level feature for writing asynchronous functions as if they are ordinary, synchronous code. JS support for this is built on top of `Promise`s and is inspired heavily by [C#'s async / await syntax](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/async/). An async function is written like this: ```ts async function someFunctionAsync() {