@warp-drive/ember 5.7.0-alpha.13 → 5.7.0-alpha.15
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 +1 -1
- package/declarations/-private/request.d.ts +13 -13
- package/declarations/index.d.ts +2 -2
- package/dist/index.js +9 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -5,7 +5,16 @@ import type { RequestLoadingState, RequestState, RequestSubscription } from "@wa
|
|
|
5
5
|
import type { StructuredErrorDocument } from "@warp-drive/core/types/request";
|
|
6
6
|
type AutorefreshBehaviorType = "online" | "interval" | "invalid";
|
|
7
7
|
type AutorefreshBehaviorCombos = boolean | AutorefreshBehaviorType | `${AutorefreshBehaviorType},${AutorefreshBehaviorType}` | `${AutorefreshBehaviorType},${AutorefreshBehaviorType},${AutorefreshBehaviorType}`;
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Utilities to assist in recovering from the error.
|
|
10
|
+
*/ export interface RecoveryFeatures {
|
|
11
|
+
isOnline: boolean;
|
|
12
|
+
isHidden: boolean;
|
|
13
|
+
retry: () => Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Utilities for keeping the request fresh
|
|
17
|
+
*/ export interface ContentFeatures<RT> {
|
|
9
18
|
isOnline: boolean;
|
|
10
19
|
isHidden: boolean;
|
|
11
20
|
isRefreshing: boolean;
|
|
@@ -13,7 +22,7 @@ type ContentFeatures<RT> = {
|
|
|
13
22
|
reload: () => Promise<void>;
|
|
14
23
|
abort?: () => void;
|
|
15
24
|
latestRequest?: Future<RT>;
|
|
16
|
-
}
|
|
25
|
+
}
|
|
17
26
|
interface RequestSignature<
|
|
18
27
|
RT,
|
|
19
28
|
T,
|
|
@@ -87,23 +96,14 @@ interface RequestSignature<
|
|
|
87
96
|
/**
|
|
88
97
|
* The block to render when the request was cancelled.
|
|
89
98
|
*
|
|
90
|
-
*/ cancelled: [error: StructuredErrorDocument<E>, features:
|
|
91
|
-
isOnline: boolean;
|
|
92
|
-
isHidden: boolean;
|
|
93
|
-
retry: () => Promise<void>;
|
|
94
|
-
}];
|
|
99
|
+
*/ cancelled: [error: StructuredErrorDocument<E>, features: RecoveryFeatures];
|
|
95
100
|
/**
|
|
96
101
|
* The block to render when the request failed. If this block is not provided,
|
|
97
102
|
* the error will be rethrown.
|
|
98
103
|
*
|
|
99
104
|
* Thus it is required to provide an error block and proper error handling if
|
|
100
105
|
* you do not want the error to crash the application.
|
|
101
|
-
|
|
102
|
-
*/ error: [error: StructuredErrorDocument<E>, features: {
|
|
103
|
-
isOnline: boolean;
|
|
104
|
-
isHidden: boolean;
|
|
105
|
-
retry: () => Promise<void>;
|
|
106
|
-
}];
|
|
106
|
+
*/ error: [error: StructuredErrorDocument<E>, features: RecoveryFeatures];
|
|
107
107
|
/**
|
|
108
108
|
* The block to render when the request succeeded.
|
|
109
109
|
*
|
package/declarations/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* ## Installation
|
|
5
5
|
*
|
|
6
|
-
* ```
|
|
6
|
+
* ```sh
|
|
7
7
|
* pnpm install @warp-drive/ember
|
|
8
8
|
* ```
|
|
9
9
|
*
|
|
@@ -146,7 +146,7 @@ export { getPromiseState } from "@warp-drive/core/store/-private";
|
|
|
146
146
|
* interface Future<T> extends Promise<T>> {
|
|
147
147
|
* getStream(): Promise<ReadableStream>;
|
|
148
148
|
* abort(): void;
|
|
149
|
-
* lid:
|
|
149
|
+
* lid: RequestKey | null;
|
|
150
150
|
* }
|
|
151
151
|
* ```
|
|
152
152
|
*
|
package/dist/index.js
CHANGED
|
@@ -158,6 +158,15 @@ if (macroCondition(moduleExists('ember-provide-consume-context'))) {
|
|
|
158
158
|
} = importSync('ember-provide-consume-context');
|
|
159
159
|
consume = contextConsume;
|
|
160
160
|
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Utilities to assist in recovering from the error.
|
|
164
|
+
*/
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Utilities for keeping the request fresh
|
|
168
|
+
*/
|
|
169
|
+
|
|
161
170
|
/**
|
|
162
171
|
* The `<Request />` component is a powerful tool for managing data fetching and
|
|
163
172
|
* state in your Ember application. It provides a declarative approach to reactive
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warp-drive/ember",
|
|
3
3
|
"description": "Data bindings and utilities for Ember applications using WarpDrive",
|
|
4
|
-
"version": "5.7.0-alpha.
|
|
4
|
+
"version": "5.7.0-alpha.15",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Chris Thoburn <runspired@users.noreply.github.com>",
|
|
7
7
|
"repository": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@embroider/macros": "^1.16.12",
|
|
41
|
-
"@warp-drive/core": "5.7.0-alpha.
|
|
41
|
+
"@warp-drive/core": "5.7.0-alpha.15"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|
|
44
44
|
"ember-provide-consume-context": {
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"@embroider/addon-dev": "^7.1.3",
|
|
61
61
|
"@ember/test-helpers": "5.2.0",
|
|
62
62
|
"@ember/test-waiters": "^4.1.0",
|
|
63
|
-
"@warp-drive/internal-config": "5.7.0-alpha.
|
|
64
|
-
"@warp-drive/core": "5.7.0-alpha.
|
|
63
|
+
"@warp-drive/internal-config": "5.7.0-alpha.15",
|
|
64
|
+
"@warp-drive/core": "5.7.0-alpha.15",
|
|
65
65
|
"babel-plugin-ember-template-compilation": "^2.4.1",
|
|
66
66
|
"ember-template-imports": "^4.3.0",
|
|
67
67
|
"ember-source": "~6.3.0",
|