Created
June 27, 2022 09:42
-
-
Save NyaGarcia/1e843737e543cba44d42135f628df493 to your computer and use it in GitHub Desktop.
Using takUntil to make the Observable complete
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
dialogRef | |
.afterClosed() | |
.pipe( | |
filter(Boolean), | |
tap((pokemon) => this.pokedexService.create(pokemon)), | |
takeUntil(this.destroyed$) // Will force the Observable to complete when destroyed$ emits a value | |
) | |
.subscribe(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment