ObservableInput<T> should support Thennable<T>, not PromiseLike<T>
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 31.7k
- Forks
- 3k
- PR merge metrics
- No merged PRs in 30d
Description
The type on ObservableInput is probably too strict.
We'll want to support Thennable<T> instead, as that's all that is required to convert with from et al.
interface Thennable<T> {
then(onresolved?: ((value: T) => void) | null | undefined, onrejected?: ((reason: any) => void) | null | undefined): void;
}
The upside is we can then support more. The downside is if we decide we need to rely on the returned value of the then function, It'll require a breaking change.
Implementor note: We probably don't want to publicly expose Thennable, I'm sure a lot of folks already have that implemented in their codebase. It's been a mistake that we export * from types, honestly.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the public ObservableInput definition and the from conversion entry points, then inspect how PromiseLike is currently used. Done means compatible thenable implementations are accepted without publicly exporting Thennable, while the existing conversion behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100