Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing child class members #70

Open
axos88 opened this issue Oct 7, 2024 · 0 comments
Open

Accessing child class members #70

axos88 opened this issue Oct 7, 2024 · 0 comments

Comments

@axos88
Copy link

axos88 commented Oct 7, 2024

Is it possible to write something like this oversimplified snippet:

  class Filterable<T, F> {
    protected service: CrudService<T>

    protected filter$ = new BehaviourSubject<F>(null);
    protected filteredData$ = filter$.pipe(switchMap(f => this.service.filteredBy(f)) // use of this.service before initialization

    filter(f: Partial<F>) {
      this.filter$.next(f)
    }

  class ConcreteService extends CrudService<Foo, FooFilter> { ... }
  
  class Controller extends Mixin(Filterable<Foo, FooFilter>, XXX) {
    protected service = new ConcreteService(...);

    (... random uses of filter() and filteredData$ )
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant