@spoosh/plugin-prefetch 0.1.2 → 0.1.4

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/README.md CHANGED
@@ -35,7 +35,7 @@ await prefetch((api) => api.posts.$get({ query: { page: 1, limit: 10 } }));
35
35
 
36
36
  // Prefetch with plugin options (staleTime, retries, etc.)
37
37
  await prefetch(
38
- (api) => api.users[userId].$get(),
38
+ (api) => api.users(userId).$get(),
39
39
  {
40
40
  staleTime: 60000,
41
41
  retries: 3,
@@ -45,7 +45,7 @@ await prefetch(
45
45
  // Prefetch on hover
46
46
  <Link
47
47
  href="/posts/1"
48
- onMouseEnter={() => prefetch((api) => api.posts[1].$get())}
48
+ onMouseEnter={() => prefetch((api) => api.posts(1).$get())}
49
49
  >
50
50
  View Post
51
51
  </Link>
@@ -55,8 +55,8 @@ await prefetch(
55
55
 
56
56
  ### Plugin Config
57
57
 
58
- | Option | Type | Default | Description |
59
- | ---------------- | -------- | ------- | ----------------------------------------------------------------- |
58
+ | Option | Type | Default | Description |
59
+ | ----------- | -------- | ------- | ----------------------------------------------------------------- |
60
60
  | `staleTime` | `number` | - | Default stale time for prefetched data (ms) |
61
61
  | `timeout` | `number` | `30000` | Timeout to auto-clear stale promises (ms). Prevents memory leaks. |
62
62
 
package/dist/index.d.mts CHANGED
@@ -58,7 +58,7 @@ declare module "@spoosh/core" {
58
58
  * await prefetch((api) => api.posts.$get({ query: { page: 1, limit: 10 } }));
59
59
  *
60
60
  * // Prefetch with plugin options (staleTime, retries, etc.)
61
- * await prefetch((api) => api.users[userId].$get(), {
61
+ * await prefetch((api) => api.users(userId).$get(), {
62
62
  * staleTime: 60000,
63
63
  * retries: 3,
64
64
  * });
@@ -66,7 +66,7 @@ declare module "@spoosh/core" {
66
66
  * // Prefetch on hover
67
67
  * <Link
68
68
  * href="/posts/1"
69
- * onMouseEnter={() => prefetch((api) => api.posts[1].$get())}
69
+ * onMouseEnter={() => prefetch((api) => api.posts(1).$get())}
70
70
  * >
71
71
  * View Post
72
72
  * </Link>
package/dist/index.d.ts CHANGED
@@ -58,7 +58,7 @@ declare module "@spoosh/core" {
58
58
  * await prefetch((api) => api.posts.$get({ query: { page: 1, limit: 10 } }));
59
59
  *
60
60
  * // Prefetch with plugin options (staleTime, retries, etc.)
61
- * await prefetch((api) => api.users[userId].$get(), {
61
+ * await prefetch((api) => api.users(userId).$get(), {
62
62
  * staleTime: 60000,
63
63
  * retries: 3,
64
64
  * });
@@ -66,7 +66,7 @@ declare module "@spoosh/core" {
66
66
  * // Prefetch on hover
67
67
  * <Link
68
68
  * href="/posts/1"
69
- * onMouseEnter={() => prefetch((api) => api.posts[1].$get())}
69
+ * onMouseEnter={() => prefetch((api) => api.posts(1).$get())}
70
70
  * >
71
71
  * View Post
72
72
  * </Link>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spoosh/plugin-prefetch",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Prefetch plugin for Spoosh - preload data before it's needed",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -11,7 +11,7 @@
11
11
  "bugs": {
12
12
  "url": "https://github.com/nxnom/spoosh/issues"
13
13
  },
14
- "homepage": "https://spoosh.dev/docs/plugins/prefetch",
14
+ "homepage": "https://spoosh.dev/react/docs/plugins/prefetch",
15
15
  "publishConfig": {
16
16
  "access": "public"
17
17
  },
@@ -33,11 +33,11 @@
33
33
  }
34
34
  },
35
35
  "peerDependencies": {
36
- "@spoosh/core": ">=0.3.0"
36
+ "@spoosh/core": ">=0.4.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@spoosh/core": "0.3.0",
40
- "@spoosh/test-utils": "0.1.3"
39
+ "@spoosh/core": "0.4.2",
40
+ "@spoosh/test-utils": "0.1.5"
41
41
  },
42
42
  "scripts": {
43
43
  "dev": "tsup --watch",