I am playing around with pipe and subscribe. If I am using pipe with tap, nothing will log in console. If I am using subscribe, it's working. So what I am doing wrong?
import { Observable } from 'rxjs';
import { tap, take } from 'rxjs/operators';
this.store.select(state => state.auth.authUser).pipe(
take(1),
tap((data) => {
//Not Working - no console output
console.log('[Tap] User Data', data);
})
);
this.store.select(state => state.auth.authUser).subscribe((data) => {
// Working - user data output in console
console.log('[Subscribe] User Data', data);
})
I am using RxJs 6, TypeScript and ngxs as store in Angular 6.