@centreon/ui 23.10.28 → 23.10.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@centreon/ui",
3
- "version": "23.10.28",
3
+ "version": "23.10.29",
4
4
  "description": "Centreon UI Components",
5
5
  "scripts": {
6
6
  "eslint": "eslint ./src --ext .js,.jsx,.ts,.tsx --max-warnings 0",
@@ -2,6 +2,7 @@ import { useRef, useCallback } from 'react';
2
2
 
3
3
  interface HookParam {
4
4
  action: () => void;
5
+ intersectionObserverOptions?: IntersectionObserverInit;
5
6
  loading: boolean;
6
7
  maxPage: number;
7
8
  page: number;
@@ -11,7 +12,8 @@ export const useIntersectionObserver = ({
11
12
  maxPage,
12
13
  page,
13
14
  loading,
14
- action
15
+ action,
16
+ intersectionObserverOptions
15
17
  }: HookParam): ((node) => void) => {
16
18
  const observer = useRef<IntersectionObserver | null>(null);
17
19
  const lastElementRef = useCallback(
@@ -30,7 +32,7 @@ export const useIntersectionObserver = ({
30
32
  if (entry.isIntersecting && page < maxPage) {
31
33
  action();
32
34
  }
33
- });
35
+ }, intersectionObserverOptions);
34
36
 
35
37
  if (node && observer.current) {
36
38
  observer.current.observe(node);