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

Open
#301 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
typescript
Domain
tooling

Research direction

Start in src/lazy-observable.ts around line 45 and read the linked code example showing current() compared with undefined. Check the TypeScript return type against the unresolved-promise behavior; done means the public signature accurately permits the value demonstrated by the example.

Written by the indexing model from the issue text.

Description

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.

Dominant language
TypeScript
Stars
1.2k
Forks
130
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mobxjs/mobx-utils

All issues in mobxjs/mobx-utils

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.