fromEvent(Document) not typing correctly (still, ugh), boolean event useCapture option broken in TS
Open
Nobody has claimed this yet.
7.x
bug
- Dominant language
- TypeScript
- Stars
- 31.7k
- Forks
- 3k
- PR merge metrics
- No merged PRs in 30d
Description
I found this while updating another project from 5.5.* to 7.2.0. Basically, this doesn't work properly:
import { fromEvent } from 'rxjs';
declare const document: Document; // or just use document, duh
const result = fromEvent(document, 'click', true);
// Fails on two levels: 1 for `document` being invalid type, the other for `true` instead of `{ useCapture: true }`.
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
Start at the fromEvent entry point and reproduce the TypeScript example with Document and the boolean useCapture argument. Trace the relevant typings and verify that both the document target and the true option type-check correctly when the example is complete.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 40/100