The following code doesn't subscribe:
this.store
.select(petSelectors.selectPetData)
.pipe(find(x => x.petName === petName)).subscribe(x => console.log(x));
But if I do this, it does subscribe:
this.store.select(petSelectors.selectPetData).subscribe(x => console.log(x));
UPDATE: this works too
const x = this.store .select(petSelectors.selectPetData).pipe(find(x => x));
but when I add the logic, it doesn't
I'm following the RxJS official documentation: https://rxjs-dev.firebaseapp.com/api/operators/find
I have even to tried inside the pipe(), try with take(1), map(), etc
and when I do the .subcribe()
, nothing gets printed. I have tried using the async
pipe as well.
Object:
{
"petName": "devpato"
}
The pet name I'm passing is to compare the object with is 'devpato'
.pipe(map(x => x))
, you dont get the same result as without thepipe
? – ConnorsFan.map()
but the.find()
still not working if i put the logic. this workedconst x = this.store .select(petSelectors.selectPetData).pipe(find(x => x));
– Patricio Vargas.pipe(tap(x => console.log(x)).subscribe()
? – btx