Skip to content

Commit

Permalink
Add import statement to visibilityFilter example (#3487)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dalyhabit authored and timdorr committed Jul 31, 2019
1 parent 59cc278 commit 03cb88a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/basics/Reducers.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ function todoApp(state = initialState, action) {
Now let's handle `SET_VISIBILITY_FILTER`. All it needs to do is to change `visibilityFilter` on the state. Easy:

```js
import {
SET_VISIBILITY_FILTER,
VisibilityFilters
} from './actions'

...

function todoApp(state = initialState, action) {
switch (action.type) {
case SET_VISIBILITY_FILTER:
Expand Down

0 comments on commit 03cb88a

Please sign in to comment.