Skip to content

Commit 13bd4d9

Browse files
evertbouwmarkerikson
authored andcommitted
use modern syntax in redux-observable example (#251)
RxJS 6 deprecated method operators in favor of pipeline operators. These can be imported individually which improves developer experience and bundle size.
1 parent 8a6d60a commit 13bd4d9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

docs/api/createAction.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,11 @@ The `match` method can also be used as a filter method, which makes it powerful
168168
const increment = createAction<number>('INCREMENT')
169169

170170
export const epic = (actions$: Observable<Action>) =>
171-
actions$.filter(increment.match).map(action => {
172-
// action.payload can be safely used as number here (and will also be correctly inferred by TypeScript)
173-
// ...
174-
})
171+
actions$.pipe(
172+
filter(increment.match),
173+
map(action => {
174+
// action.payload can be safely used as number here (and will also be correctly inferred by TypeScript)
175+
// ...
176+
})
177+
)
175178
```

0 commit comments

Comments
 (0)