Last active
December 12, 2019 08:49
-
-
Save Sawtaytoes/559f04994a09dfe02f9bcdec7ab7f185 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
const connectToServerEpic = ( | |
action$, | |
) => ( | |
action$ | |
.pipe( | |
ofType(CONNECT_TO_SERVER), | |
switchMap(({ | |
// ... | |
}) => ( | |
action$ | |
.pipe( | |
ofType(RECONNECT_TO_SERVER), | |
// ... | |
startWith(null), | |
map(() => ( | |
// This is where we create `webSocketConnection$` | |
webSocket({ | |
// ... | |
}) | |
)), | |
switchMap(( | |
webSocketConnection$, | |
) => ( | |
// ... | |
)), | |
// ... | |
) | |
)), | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment