Skip to content

How should we handle factory selectors driven from component @Input #3505

Answered by e-oz
eggbeard asked this question in Q&A
Discussion options

You must be logged in to vote
@Input() set id(id: number) {
    if (id != null) {
        this.id$.next(id);
    }
}

protected readonly id$ = new ReplaySubject<number>(1);

and use this.id$ observable.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by eggbeard
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants