Skip to content

Improvements to the component and API

Compare
Choose a tag to compare
@ljbc1994 ljbc1994 released this 19 May 09:16
· 27 commits to master since this release
e9ca60d
  • IntersectionObserve now requires a reference to the node it's observing, means the component only deals with observing and not polluted with Class or Style.

Now the component's context includes a reference which needs to be provided with the element that needs to be observed.

@using Blazor.IntersectionObserver

<IntersectionObserve>
    <div @ref="context.Ref.Current">
        Hey... I'm @(context.IsIntersecting ? "in view": "out of view")
    </div>
</IntersectionObserve>
  • A new dispose method on the service rather than disconnect. Disconnect follows the API and removes any elements that are being observed but does not remove the observer.
  • Remove underlying shared observer, instead each IntersectionObserve instance will have their own observer.
  • Updates to documentation to reflect the above changes.
  • Include a minified script file for js import.
  • Bump outdated npm packages.