Skip to content

Commit 03cb88a

Browse files
dalyhabittimdorr
authored andcommitted
Add import statement to visibilityFilter example (#3487)
In this code example, SET_VISIBILITY_FILTER is used in a switch case, but it is never imported first. It is imported in the subsequent example code block in the docs. This is confusing, especially for users who aren't familiar with switch statements.
1 parent 59cc278 commit 03cb88a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/basics/Reducers.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ function todoApp(state = initialState, action) {
9292
Now let's handle `SET_VISIBILITY_FILTER`. All it needs to do is to change `visibilityFilter` on the state. Easy:
9393

9494
```js
95+
import {
96+
SET_VISIBILITY_FILTER,
97+
VisibilityFilters
98+
} from './actions'
99+
100+
...
101+
95102
function todoApp(state = initialState, action) {
96103
switch (action.type) {
97104
case SET_VISIBILITY_FILTER:

0 commit comments

Comments
 (0)