1
const sites$: Observable<ISiteData<IRoleData>[]> = this.store.select('auth', 'user', 'sites');

sites$.pipe(
            tap((x) => console.log(x)),
            takeUntil(this.unsubscribe$$),
        );
sites$.subscribe((val: any) => console.log(val)).unsubscribe();

In this situation, the subscribe method is printing the entire object returned. The pipe is not printing anything. How / Why is this going wrong ?

I need to be get the both of them to work the same way.

2

1 Answer 1

2

Because pipe creates new wrapped obserable that you should subscribe to.

What you should do is

observable.pipe(....).subscribe();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.