Skip to content

Instantly share code, notes, and snippets.

@jsonberry
Last active January 9, 2019 00:14

Revisions

  1. jsonberry revised this gist Jan 9, 2019. 1 changed file with 0 additions and 12 deletions.
    12 changes: 0 additions & 12 deletions ignoreFalsyValues.ts
    Original file line number Diff line number Diff line change
    @@ -1,12 +0,0 @@
    import { from } from 'rxjs';
    import { someApiService } from './some-api.service';

    from([
    'I',
    false,
    'am',
    null,
    'truthy',
    ]).pipe(
    ignoreFalsyValues(),
    ).subscribe(signal => console.log(signal)); // "I", "am", "truthy"
  2. jsonberry revised this gist Jan 9, 2019. 2 changed files with 14 additions and 2 deletions.
    12 changes: 12 additions & 0 deletions ignoreFalsyValues.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    import { from } from 'rxjs';
    import { someApiService } from './some-api.service';

    from([
    'I',
    false,
    'am',
    null,
    'truthy',
    ]).pipe(
    ignoreFalsyValues(),
    ).subscribe(signal => console.log(signal)); // "I", "am", "truthy"
    4 changes: 2 additions & 2 deletions tapLog.ts
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,6 @@ import { of } from 'rxjs';
    import { tapLog } from 'rxjs-toolkit';

    of('hello').pipe(
    tapLog(), // log out whatever the signal is, so 'hello'
    tapLog('labelFoo') // give it a label, { labelFoo: 'hello' }
    tapLog(), // log out whatever the signal is, so "hello"
    tapLog('labelFoo') // give it a label, { labelFoo: "hello" }
    ).subscribe()
  3. jsonberry renamed this gist Jan 9, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. jsonberry created this gist Jan 9, 2019.
    7 changes: 7 additions & 0 deletions tapLog.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    import { of } from 'rxjs';
    import { tapLog } from 'rxjs-toolkit';

    of('hello').pipe(
    tapLog(), // log out whatever the signal is, so 'hello'
    tapLog('labelFoo') // give it a label, { labelFoo: 'hello' }
    ).subscribe()