Last active
May 7, 2021 17:55
-
-
Save NyaGarcia/108faab1122e120706e1edfa3af237fc to your computer and use it in GitHub Desktop.
Misuse of subscribe by placing logic inside it
This file contains hidden or 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
| pokemon$.subscribe((pokemon: Pokemon) => { | |
| if (pokemon.type === "Water") { | |
| return; | |
| } | |
| const pokemonStats = getStats(pokemon); | |
| logStats(pokemonStats); | |
| saveToPokedex(pokemonStats); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment