Created
March 4, 2021 11:01
-
-
Save Coly010/6c5bd73780f4aa0389cd78796a4bef59 to your computer and use it in GitHub Desktop.
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
| //We can add a label to the logs: | |
| const obs$ = of('my test value'); | |
| obs$.pipe(debug('Obserable A')).subscribe(); | |
| // OUTPUT: | |
| // Obserable A my test value | |
| // We can label it using the config object syntax: | |
| const obs$ = of('my test value'); | |
| obs$.pipe(debug({ label: 'Obserable A' })).subscribe(); | |
| // OUTPUT: | |
| // Obserable A my test value | |
| // However, if we add a label and custom notification handlers, | |
| // we will not get the label in the logs by default: | |
| const obs$ = of('my test value'); | |
| obs$ | |
| .pipe( | |
| debug({ | |
| label: 'Obserable A', | |
| next: (value) => console.log(value), | |
| }) | |
| ) | |
| .subscribe(); | |
| // OUTPUT: | |
| // my test value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment