@spoosh/plugin-prefetch 0.5.0 → 0.5.1

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/dist/index.d.mts CHANGED
@@ -1,4 +1,5 @@
1
- import { ReadSchemaHelper, SpooshResponse, TagOptions, SpooshPlugin } from '@spoosh/core';
1
+ import * as _spoosh_core from '@spoosh/core';
2
+ import { ReadSchemaHelper, SpooshResponse, TagOptions } from '@spoosh/core';
2
3
 
3
4
  interface PrefetchPluginConfig {
4
5
  /** Default stale time for prefetched data in milliseconds */
@@ -72,7 +73,7 @@ declare module "@spoosh/core" {
72
73
  * </Link>
73
74
  * ```
74
75
  */
75
- declare function prefetchPlugin(config?: PrefetchPluginConfig): SpooshPlugin<{
76
+ declare function prefetchPlugin(config?: PrefetchPluginConfig): _spoosh_core.SpooshPlugin<{
76
77
  instanceApi: PrefetchInstanceApi;
77
78
  }>;
78
79
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { ReadSchemaHelper, SpooshResponse, TagOptions, SpooshPlugin } from '@spoosh/core';
1
+ import * as _spoosh_core from '@spoosh/core';
2
+ import { ReadSchemaHelper, SpooshResponse, TagOptions } from '@spoosh/core';
2
3
 
3
4
  interface PrefetchPluginConfig {
4
5
  /** Default stale time for prefetched data in milliseconds */
@@ -72,7 +73,7 @@ declare module "@spoosh/core" {
72
73
  * </Link>
73
74
  * ```
74
75
  */
75
- declare function prefetchPlugin(config?: PrefetchPluginConfig): SpooshPlugin<{
76
+ declare function prefetchPlugin(config?: PrefetchPluginConfig): _spoosh_core.SpooshPlugin<{
76
77
  instanceApi: PrefetchInstanceApi;
77
78
  }>;
78
79
 
package/dist/index.js CHANGED
@@ -52,7 +52,7 @@ function storePromiseInCache(promise, options) {
52
52
  var PLUGIN_NAME = "spoosh:prefetch";
53
53
  function prefetchPlugin(config = {}) {
54
54
  const { timeout } = config;
55
- return {
55
+ return (0, import_core.createSpooshPlugin)({
56
56
  name: PLUGIN_NAME,
57
57
  operations: [],
58
58
  instanceApi(context) {
@@ -169,5 +169,5 @@ function prefetchPlugin(config = {}) {
169
169
  };
170
170
  return { prefetch };
171
171
  }
172
- };
172
+ });
173
173
  }
package/dist/index.mjs CHANGED
@@ -3,7 +3,8 @@ import {
3
3
  createSelectorProxy,
4
4
  resolvePath,
5
5
  resolveTags,
6
- createInitialState
6
+ createInitialState,
7
+ createSpooshPlugin
7
8
  } from "@spoosh/core";
8
9
 
9
10
  // src/promise-cache.ts
@@ -31,7 +32,7 @@ function storePromiseInCache(promise, options) {
31
32
  var PLUGIN_NAME = "spoosh:prefetch";
32
33
  function prefetchPlugin(config = {}) {
33
34
  const { timeout } = config;
34
- return {
35
+ return createSpooshPlugin({
35
36
  name: PLUGIN_NAME,
36
37
  operations: [],
37
38
  instanceApi(context) {
@@ -148,7 +149,7 @@ function prefetchPlugin(config = {}) {
148
149
  };
149
150
  return { prefetch };
150
151
  }
151
- };
152
+ });
152
153
  }
153
154
  export {
154
155
  prefetchPlugin
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spoosh/plugin-prefetch",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Prefetch plugin for Spoosh - preload data before it's needed",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -36,7 +36,7 @@
36
36
  "@spoosh/core": ">=0.15.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@spoosh/core": "0.15.0",
39
+ "@spoosh/core": "0.15.1",
40
40
  "@spoosh/test-utils": "0.3.0"
41
41
  },
42
42
  "scripts": {