Open thesnups opened 6 years ago
IMHO this lib is kind of alternative to IntersectionObserver
, so there is not much sense using the latter inside the lib.
The value of this lib is that it serves same purposes as IntersectionObserver
while grounding on very basic browser API and thus having much broader browser support.
I think it's up to consumer (you) to decide whether to use IntersectionObserver
when it's available or this lib :)
As a counterpoint @N1kto, if this library feature checked IntersectionObserver
and used it when available, you would get the assumed performance improvements of that API when available... but also achieve broader browser support by falling back to the methods currently in use here.
It is a further benefit to the consumer to not have to have multiple implementations within the codebase.
I agree with @mjsisley. As a programmer I'd like to be able to code again a consistent API (e.g. the emergence.js API) whilst knowing that the performance benefits of IntersectionObserver are being leveraged when they are available.
Why not feature check for IntersectionObserver support and use it when available?