Releases: Coly010/rxjs-debug-operator
Releases · Coly010/rxjs-debug-operator
Add Label Option
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
Verbose Logging Options
🔥 rxjs-debug-operator v1.1.1 has been released!
The latest update allows for logging of:
- next notifications 🤩
- error notifications ⛔
- complete notifications 🥳
🚀 Check it out:
https://github.com/Coly010/rxjs-debug-operator
💡 By default debug()
will
- console.log the value received from the source observable
- console.error the error received from the source observable
- no-op complete notifications received from the source observable
⚡ It takes a config argument that allows you to specify:
- an ignore-case
- a custom next notification handler
- a custom error notification handler
- a custom complete notification handler