react-visibility-hooks 1.0.7 → 1.0.8

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.
Files changed (2) hide show
  1. package/README.md +6 -8
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -21,12 +21,6 @@ A collection of lightweight React hooks that help you build performance-consciou
21
21
  npm install react-visibility-hooks
22
22
  ```
23
23
 
24
- For `useSmartPolling`, you'll also need to install `@tanstack/react-query`:
25
-
26
- ```bash
27
- npm install @tanstack/react-query
28
- ```
29
-
30
24
  ## Hooks
31
25
 
32
26
  ### `useDocVisible`
@@ -104,7 +98,7 @@ function VideoPlayer() {
104
98
 
105
99
  ### `useSmartPolling`
106
100
 
107
- Smart polling that only refetches data when the page is visible. Built on top of [@tanstack/react-query](https://tanstack.com/query).
101
+ Smart polling that only fetches data when the page is visible. Zero additional dependencies required.
108
102
 
109
103
  **Use cases:**
110
104
  - Real-time dashboards
@@ -126,7 +120,11 @@ function Dashboard() {
126
120
  }
127
121
  ```
128
122
 
129
- **Note:** This hook requires `@tanstack/react-query` to be installed. Polling is automatically paused when the tab is hidden and resumes when visible (default interval: 5 seconds).
123
+ **Options:**
124
+ - `interval` (optional): Polling interval in milliseconds (default: 5000)
125
+ - `enabled` (optional): Enable/disable polling (default: true)
126
+
127
+ Polling is automatically paused when the tab is hidden and resumes when visible.
130
128
 
131
129
  ## SSR Support
132
130
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-visibility-hooks",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Tiny, SSR-safe React hooks for page visibility, idle detection and smart polling",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",