Skip to content

Instantly share code, notes, and snippets.

@jsonberry
Last active January 9, 2019 00:14
Show Gist options
  • Save jsonberry/7eafd5f30106a078e2fbf56d2567bbb0 to your computer and use it in GitHub Desktop.
Save jsonberry/7eafd5f30106a078e2fbf56d2567bbb0 to your computer and use it in GitHub Desktop.
rxjs-toolkit examples
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"
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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment