DOM lib is missing Intersection Observer API on window global
See original GitHub issueTypeScript Version: 2.3.4
Code
The browser Intersection Observer API defines these on the window:
window.IntersectionObserver
window.IntersectionObserverEntry
Expected behavior: These should be defined in the DOM lib typings.
Actual behavior: They are not defined, so I get type errors.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
DOM lib is missing Intersection Observer API on window global
TypeScript Version: 2.3.4 Code The browser Intersection Observer API defines these on the window: window.IntersectionObserver window.
Read more >Intersection Observer API - MDN Web Docs
Consider a web page that uses infinite scrolling. It uses a vendor-provided library to manage the advertisements placed periodically throughout ...
Read more >intersection-observer - npm
This library polyfills the native IntersectionObserver API in unsupporting browsers. See the API documentation for usage information.
Read more >Mock for intersection observer in jest and typescript
A simple implementation would be: window.IntersectionObserver = jest.fn(() => ({ takeRecords: jest.fn ...
Read more >Intersection Observer API - David Walsh Blog
It's because of this that so many of the recent development efforts have been focused around rendering, with virtual DOM being one of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As a temporary fix
IntersectionObserverEntry lacks isVisible property. Chrome Version 87.0.4280.88
Edit: after a quick test, this isVisible seems to be always false.