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
Copy file name to clipboardexpand all lines: tests/dummy/app/templates/docs/did-intersect.md
+12
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,8 @@ You can also set a maximum limit on the number of times the callbacks should tri
35
35
36
36
## Advanced Usage
37
37
38
+
### Options
39
+
38
40
`did-intersect` also supports passing an `options` object into IntersectionObserver:
39
41
40
42
```handlebars
@@ -43,6 +45,16 @@ You can also set a maximum limit on the number of times the callbacks should tri
43
45
44
46
The options supported are documented in the MDN site under [Intersection observer options](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/IntersectionObserver#Intersection_observer_options).
45
47
48
+
### Other arguments
49
+
50
+
Besides `onEnter`, `onExit`, and `options`, `{{did-intersect}}` accepts the following named arguments:
51
+
52
+
-`maxEnter`: a maximum number of times to allow the `IntersectionObserver` to be triggered for entering the viewport
53
+
54
+
-`maxExit`: a maximum number of times to allow the `IntersectionObserver` to be triggered for entering the viewport
55
+
56
+
-`isObserving`: whether to allow the `IntersectionObserver` to trigger at all. Useful for times when you want to programmatically control enabling and disabling observation of an element based on some tracked state in your own code.
57
+
46
58
## Testing
47
59
Since the underlying IntersectionObserver behavior is non-deterministic, we provide a `did-intersect-mock` test helper to help you test `did-intersect` deterministically.
0 commit comments