You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a named new argument, `isObserving`, with a default value of
`true`, which users can pass to explicitly opt into or out of observing
an element at a given time. This allows for a declarative invocation of
the modifier itself based on tracked state, rather than having to handle
it in the callback(s) passed to the modifier.
Users can work around this today by only passing the `onEnter` or
`onExit` callbacks conditionally:
<div
{{did-intersect
onEnter=(if this.shouldDoSomething this.doSomething no-op)
onExist=(if this.shouldDoSomething this.doSomethingElse no-op)
}}
>
However, as this example shows, this is repetive (and potentially
error- prone). The new functionality allows a less error-prone, less
repetitive, more expressive approach:
<div
{{did-intersect
isObserving=this.shouldDoSomething
onEnter=this.doSomething
onExit=this.doSomethingElse
}}
>
Resolves#396
0 commit comments