Last active
October 18, 2019 23:47
-
-
Save dance2die/236f83b3e9777089f51fdb88bee0a1a9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const pingEpic = action$ => | |
action$.pipe( | |
ofType(PING), | |
// 1️⃣ from "delay(1000)" to 👇 | |
switchMap(() => timer(1000)), | |
mapTo(pong()), | |
tap(console.info) | |
); | |
// 2️⃣ pongEpic stays the same. | |
export const pongEpic = action$ => | |
action$.pipe( | |
ofType(PONG), | |
delay(1000), | |
mapTo(ping()), | |
tap(console.info) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment