Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
rxjs-toolkit examples
import { of } from 'rxjs';
import { propsAreTruthy, tapLog } from 'rxjs-toolkit';
const source$ = of({
foo: {
bar: {
baz: 'truthy!',
},
},
zap: {
zing: false,
},
ping: true
});
source$.pipe(
propsAreTruthy(
'foo.bar.baz', // "baz: 'truthy'" will pass!
'ping', // "ping: true" will pass!
'zap.zing', // "zing: false" Fail, zing is not truthy, map signal to false
'rxjs.toolkit', // this path doesn't exist, it would also trigger the map to false
),
tapLog(), // false
).subscribe();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.