@spoosh/plugin-prefetch 0.1.0-beta.0 → 0.1.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.
Files changed (2) hide show
  1. package/README.md +9 -2
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -13,11 +13,18 @@ npm install @spoosh/plugin-prefetch
13
13
  ## Usage
14
14
 
15
15
  ```typescript
16
+ import { Spoosh } from "@spoosh/core";
17
+ import { createReactSpoosh } from "@spoosh/react";
16
18
  import { prefetchPlugin } from "@spoosh/plugin-prefetch";
19
+ import { cachePlugin } from "@spoosh/plugin-cache";
20
+ import { retryPlugin } from "@spoosh/plugin-retry";
17
21
 
18
22
  // Setup - prefetch is returned from createReactSpoosh
19
- const plugins = [prefetchPlugin(), cachePlugin(), retryPlugin()];
20
- const spoosh = createSpoosh<ApiSchema, Error, typeof plugins>({ baseUrl: "/api", plugins });
23
+ const spoosh = new Spoosh<ApiSchema, Error>("/api").use([
24
+ prefetchPlugin(),
25
+ cachePlugin(),
26
+ retryPlugin(),
27
+ ]);
21
28
  const { useRead, useWrite, prefetch } = createReactSpoosh(spoosh);
22
29
 
23
30
  // Basic prefetch
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spoosh/plugin-prefetch",
3
- "version": "0.1.0-beta.0",
3
+ "version": "0.1.1",
4
4
  "description": "Prefetch plugin for Spoosh - preload data before it's needed",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -33,11 +33,11 @@
33
33
  }
34
34
  },
35
35
  "peerDependencies": {
36
- "@spoosh/core": ">=0.1.0"
36
+ "@spoosh/core": ">=0.2.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@spoosh/core": "0.1.0-beta.0",
40
- "@spoosh/test-utils": "0.1.0-beta.0"
39
+ "@spoosh/core": "0.2.0",
40
+ "@spoosh/test-utils": "0.1.1"
41
41
  },
42
42
  "scripts": {
43
43
  "dev": "tsup --watch",