mobxjs / mobx-utils

Utility functions and common patterns for MobX
MIT License
1.19k stars 126 forks source link

lazyObservable.current is missing `| undefined` in type signature #301

Open lukebjerring opened 2 years ago

lukebjerring commented 2 years ago

https://github.com/mobxjs/mobx-utils/blob/3a1ee03527950a44c5ce57007344a56a9b974c94/src/lazy-observable.ts#L45

Given that we're fine to omit the initial value fallback, current() can return undefined while the promise is unresolved. The code snippet example even compares current() === undefined.

Nokel81 commented 1 month ago

This seems to be resolved in the latest version, it is now dependent on if you provide an initial value