@spoosh/plugin-cache 0.2.1 → 0.2.2

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.js CHANGED
@@ -42,19 +42,7 @@ function cachePlugin(config = {}) {
42
42
  }
43
43
  }
44
44
  }
45
- const response = await next();
46
- if (response.data !== void 0 && !response.error) {
47
- context.stateManager.setCache(context.queryKey, {
48
- state: {
49
- data: response.data,
50
- error: void 0,
51
- timestamp: Date.now()
52
- },
53
- tags: context.tags,
54
- stale: false
55
- });
56
- }
57
- return response;
45
+ return await next();
58
46
  },
59
47
  instanceApi(context) {
60
48
  const { stateManager } = context;
package/dist/index.mjs CHANGED
@@ -16,19 +16,7 @@ function cachePlugin(config = {}) {
16
16
  }
17
17
  }
18
18
  }
19
- const response = await next();
20
- if (response.data !== void 0 && !response.error) {
21
- context.stateManager.setCache(context.queryKey, {
22
- state: {
23
- data: response.data,
24
- error: void 0,
25
- timestamp: Date.now()
26
- },
27
- tags: context.tags,
28
- stale: false
29
- });
30
- }
31
- return response;
19
+ return await next();
32
20
  },
33
21
  instanceApi(context) {
34
22
  const { stateManager } = context;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spoosh/plugin-cache",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Response caching plugin for Spoosh with configurable stale time",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -33,10 +33,10 @@
33
33
  }
34
34
  },
35
35
  "peerDependencies": {
36
- "@spoosh/core": ">=0.4.0"
36
+ "@spoosh/core": ">=0.8.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@spoosh/core": "0.6.0",
39
+ "@spoosh/core": "0.8.0",
40
40
  "@spoosh/test-utils": "0.1.5"
41
41
  },
42
42
  "scripts": {