Description
Allow adding labels to Observables to help identify them
Example
// 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