- Add
boundingClientRect
as aWatcher
callback parameter.
- Add
SpanielObserver.destroy()
to cleanup memory. - Add
Watcher.destroy()
to cleanup memory.
- Fix
rootMargin
sign bug. PositiverootMargin
values should expand the offset. This is a breaking change for anyone currently settingrootMargin
. - Use native
IntersectionObserver
when available - When polling
requestAnimationFrame
, only poll every 3 frames instead of every single frame. This improves performance, but will slightly slow down reaction time to changes.
- Better TypeScript support
typings
is now defined in package.json- Use
Element
instead ofSpanielTrackedElement
for public APIs
- Publish TypeDoc API docs
- Various bug fixes
Add api for one-time determining an element's viewport state
elementSatisfiesRatio()
queryElement()
- Remove default
time
value forWatcher
constructor option.impressed
andimpression-complete
will no longer fire withouttime
option. - Remove default
ratio
value forWatcher
constructor option.visible
will no longer fire withoutratio
option.
Add public utility API
scheduleRead()
scheduleWork()
on()
setGlobalEngine()
Initial open source release