I am struggling with the following code:
id$!: Observable<string | null>;
characterDetail$!: Observable<CharacterData | undefined>; //??????
constructor(
private router: ActivatedRoute,
private store$: Store
) {}
ngOnInit(): void {
this.id$ = of(this.router.snapshot.paramMap.get('id'));
this.getCharacterDetail();
this.characterDetail$ = this.store$.select(charDetailsSelector);
}
getCharacterDetail() {
if (!this.id$) {
return;
}
this.store$.dispatch(getCharDetailsData({id: this.id$ }));
}
I encountered an issue in this section: https://i.sstatic.net/tWxgv.png