Skip to content

Releases: Coly010/rxjs-debug-operator

Add Label Option

04 Mar 11:11
Compare
Choose a tag to compare

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

28 Feb 19:12
Compare
Choose a tag to compare

🔥 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