Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 03d8bb2

Browse files
author
Kent C. Dodds
committed
fix notes a bit
1 parent e736552 commit 03d8bb2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

‎src/exercises/02.md‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ simple version of that out of what we've created so far. So for this extra
2323
credit, I want you to create a custom `useAsync` hook which can be used like so:
2424

2525
```javascript
26-
const state = useAsync(() => fetchPokemon(pokemonName), [pokemonName])
26+
const state = useAsync(() => {
27+
if (!pokemonName) {
28+
return Promise.resolve(null)
29+
}
30+
return fetchPokemon(pokemonName)
31+
}, [pokemonName])
2732
const {data: pokemon, loading, error} = state
2833
```
2934

‎src/exercises/03.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ custom hook so that the app works and the tests pass.
7373
### 💯 split up state context and dispatch context
7474

7575
Go ahead and take a short break and read this:
76-
[Always useMemo your context value](https://kentcdodds.com/blog/always-use-memo-your-context-value).
76+
[How to optimize your context value](https://kentcdodds.com/blog/how-to-optimize-your-context-value).
7777

7878
We're going to do the alternative approach mentioned at the end of that post (I
7979
plan to update the post eventually).

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /