Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
rxjs-toolkit examples
import { someApiService } from './some-api.service';
import { propsAreTruthy, ignoreFalsySignals } from 'rxjs-toolkit';
// imagine getSource$ return an object like this:
const exampleSource = {
id: '123',
origin: {
name: '',
url: '',
// say we only want a Source signal to come through if the name is truthy
// first check for this prop, if it is falsy, map to false
// if the origin name is falsy, we'll ignore the signal entirely
// but this still keeps the stream open for the next potential signal to come through
).subscribe(signal => this.doSourceThings(signal));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment