Skip to content

๐Ÿ“ A simple trace operator to help with debugging Rx streams

Notifications You must be signed in to change notification settings

ericadamski/rx-trace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Rx-Trace

๐Ÿ“ A simple trace operator to help with debugging Rx streams

API

function trace( label: string, log: Function = console.log ): (source$: Observable<any>) => Observable<any>;

Example

import { from } from 'rxjs';
import { map, filter } from 'rxjs/operators';

import trace from 'rxtrace';

from([1, 2, 3])
  .pipe(
    map(i => i * 2),
    trace('multiply'),
    filter(i => i % 3 !== 0),
    trace('not divisible by three')
  )
  .subscribe({
    next(i) {
      console.log(`result ${i}`);
    },
  });