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

Observable.get() erases typing of private fields #385

Open
simontreny opened this issue Nov 4, 2024 · 0 comments
Open

Observable.get() erases typing of private fields #385

simontreny opened this issue Nov 4, 2024 · 0 comments

Comments

@simontreny
Copy link

Consider the following pieces of code:

class Foo {
  private bar: string;

  constructor(bar: string) {
    this.bar = bar;
  }
}

const obs = observable(new Foo("bar"));

const val: Foo = obs.get();

This raises the following typescript error: Property 'bar' is missing in type '{}' but required in type 'Foo'

Expected behavior: Observable<T>.get() should always return T on a non computed observable.

Tested version: 3.0.0-beta.16

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