@ember-data-types/store 5.5.0-alpha.19 → 5.5.0-alpha.20
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/package.json +1 -1
- package/unstable-preview-types/-private/network/request-cache.d.ts +8 -8
- package/unstable-preview-types/-private/network/request-cache.d.ts.map +1 -1
- package/unstable-preview-types/-private/new-core-tmp/promise-state.d.ts +289 -0
- package/unstable-preview-types/-private/new-core-tmp/promise-state.d.ts.map +1 -0
- package/unstable-preview-types/-private/new-core-tmp/request-state.d.ts +276 -0
- package/unstable-preview-types/-private/new-core-tmp/request-state.d.ts.map +1 -0
- package/unstable-preview-types/-private.d.ts +3 -1
- package/unstable-preview-types/-private.d.ts.map +1 -1
- package/unstable-preview-types/index.d.ts +2 -0
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@ declare module '@ember-data/store/-private/network/request-cache' {
|
|
|
20
20
|
options?: Record<string, unknown>;
|
|
21
21
|
}
|
|
22
22
|
export type RequestStates = 'pending' | 'fulfilled' | 'rejected';
|
|
23
|
-
export interface
|
|
23
|
+
export interface RequestCacheRequestState {
|
|
24
24
|
state: RequestStates;
|
|
25
25
|
type: 'query' | 'mutation';
|
|
26
26
|
request: Request;
|
|
@@ -29,11 +29,11 @@ declare module '@ember-data/store/-private/network/request-cache' {
|
|
|
29
29
|
export interface Response {
|
|
30
30
|
data: unknown;
|
|
31
31
|
}
|
|
32
|
-
interface InternalRequest extends
|
|
32
|
+
interface InternalRequest extends RequestCacheRequestState {
|
|
33
33
|
[Touching]: StableRecordIdentifier[];
|
|
34
34
|
[RequestPromise]?: Promise<unknown>;
|
|
35
35
|
}
|
|
36
|
-
export type RequestSubscription = (requestState:
|
|
36
|
+
export type RequestSubscription = (requestState: RequestCacheRequestState) => void;
|
|
37
37
|
/**
|
|
38
38
|
* The RequestStateService is used to track the state of requests
|
|
39
39
|
* for fetching or updating known resource identifies that are inflight.
|
|
@@ -82,7 +82,7 @@ declare module '@ember-data/store/-private/network/request-cache' {
|
|
|
82
82
|
* @method subscribeForRecord
|
|
83
83
|
* @public
|
|
84
84
|
* @param {StableRecordIdentifier} identifier
|
|
85
|
-
* @param {(state:
|
|
85
|
+
* @param {(state: RequestCacheRequestState) => void} callback
|
|
86
86
|
*/
|
|
87
87
|
subscribeForRecord(identifier: StableRecordIdentifier, callback: RequestSubscription): void;
|
|
88
88
|
/**
|
|
@@ -91,18 +91,18 @@ declare module '@ember-data/store/-private/network/request-cache' {
|
|
|
91
91
|
* @method getPendingRequestsForRecord
|
|
92
92
|
* @public
|
|
93
93
|
* @param {StableRecordIdentifier} identifier
|
|
94
|
-
* @return {
|
|
94
|
+
* @return {RequestCacheRequestState[]} an array of request states for any pending requests for the given identifier
|
|
95
95
|
*/
|
|
96
|
-
getPendingRequestsForRecord(identifier: StableRecordIdentifier):
|
|
96
|
+
getPendingRequestsForRecord(identifier: StableRecordIdentifier): RequestCacheRequestState[];
|
|
97
97
|
/**
|
|
98
98
|
* Retrieve the last completed request for a given resource identity.
|
|
99
99
|
*
|
|
100
100
|
* @method getLastRequestForRecord
|
|
101
101
|
* @public
|
|
102
102
|
* @param {StableRecordIdentifier} identifier
|
|
103
|
-
* @return {
|
|
103
|
+
* @return {RequestCacheRequestState | null} the state of the most recent request for the given identifier
|
|
104
104
|
*/
|
|
105
|
-
getLastRequestForRecord(identifier: StableRecordIdentifier):
|
|
105
|
+
getLastRequestForRecord(identifier: StableRecordIdentifier): RequestCacheRequestState | null;
|
|
106
106
|
}
|
|
107
107
|
export {};
|
|
108
108
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-cache.d.ts","sourceRoot":"","sources":["../../../src/-private/network/request-cache.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAEhF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,KAAK,EAA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I;IAcjD,MAAM,IAAI,IAAI;IAOd,aAAa,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI;IASzC,QAAQ,CAAC,UAAU,EAAE,sBAAsB,EAAE,OAAO,EAAE,eAAe;IAQrE,QAAQ,CAAC,OAAO,EAAE,eAAe;IAwBjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,kBAAkB,CAAC,UAAU,EAAE,sBAAsB,EAAE,QAAQ,EAAE,mBAAmB;IASpF;;;;;;;OAOG;IACH,2BAA2B,CAAC,UAAU,EAAE,sBAAsB,GAAG,wBAAwB,EAAE;IAI3F;;;;;;;OAOG;IACH,uBAAuB,CAAC,UAAU,EAAE,sBAAsB,GAAG,wBAAwB,GAAG,IAAI;CAO7F"}
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
declare module '@ember-data/store/-private/new-core-tmp/promise-state' {
|
|
2
|
+
import type { Awaitable } from '@ember-data/request';
|
|
3
|
+
/**
|
|
4
|
+
* The state of a promise in the "pending"
|
|
5
|
+
* state. This is the default initial state.
|
|
6
|
+
*
|
|
7
|
+
* @typedoc
|
|
8
|
+
*/
|
|
9
|
+
export interface PendingPromise {
|
|
10
|
+
/**
|
|
11
|
+
* The status of the promise.
|
|
12
|
+
*
|
|
13
|
+
* @typedoc
|
|
14
|
+
*/
|
|
15
|
+
status: 'pending';
|
|
16
|
+
/**
|
|
17
|
+
* Whether the promise is pending.
|
|
18
|
+
*
|
|
19
|
+
* @typedoc
|
|
20
|
+
*/
|
|
21
|
+
isPending: true;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the promise is pending.
|
|
24
|
+
*
|
|
25
|
+
* @deprecated use `isPending` instead
|
|
26
|
+
* @typedoc
|
|
27
|
+
*/
|
|
28
|
+
isLoading: true;
|
|
29
|
+
/**
|
|
30
|
+
* Whether the promise has resolved
|
|
31
|
+
* successfully.
|
|
32
|
+
*
|
|
33
|
+
* @typedoc
|
|
34
|
+
*/
|
|
35
|
+
isSuccess: false;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the promise has rejected
|
|
38
|
+
* with an error.
|
|
39
|
+
*
|
|
40
|
+
* @typedoc
|
|
41
|
+
*/
|
|
42
|
+
isError: false;
|
|
43
|
+
/**
|
|
44
|
+
* Once the promise has resolved, this will
|
|
45
|
+
* be the value the promise resolved to.
|
|
46
|
+
*
|
|
47
|
+
* @typedoc
|
|
48
|
+
*/
|
|
49
|
+
value: null;
|
|
50
|
+
/**
|
|
51
|
+
* Once the promise has resolved, this will
|
|
52
|
+
* be the value the promise resolved to.
|
|
53
|
+
*
|
|
54
|
+
* @deprecated use `value` instead
|
|
55
|
+
* @typedoc
|
|
56
|
+
*/
|
|
57
|
+
result: null;
|
|
58
|
+
/**
|
|
59
|
+
* Once the promise has rejected, this will
|
|
60
|
+
* be the error the promise rejected with.
|
|
61
|
+
*
|
|
62
|
+
*
|
|
63
|
+
* @deprecated use `reason` instead
|
|
64
|
+
* @typedoc
|
|
65
|
+
*/
|
|
66
|
+
error: null;
|
|
67
|
+
/**
|
|
68
|
+
* Once the promise has rejected, this will
|
|
69
|
+
* be the error the promise rejected with.
|
|
70
|
+
*
|
|
71
|
+
* @typedoc
|
|
72
|
+
*/
|
|
73
|
+
reason: null;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The state of a promise in the "fulfilled" state.
|
|
77
|
+
* This is the state of a promise that has resolved
|
|
78
|
+
* successfully.
|
|
79
|
+
*
|
|
80
|
+
* @typedoc
|
|
81
|
+
*/
|
|
82
|
+
export interface ResolvedPromise<T> {
|
|
83
|
+
/**
|
|
84
|
+
* The status of the promise.
|
|
85
|
+
*
|
|
86
|
+
* @typedoc
|
|
87
|
+
*/
|
|
88
|
+
status: 'fulfilled';
|
|
89
|
+
/**
|
|
90
|
+
* Whether the promise is pending.
|
|
91
|
+
*
|
|
92
|
+
* @typedoc
|
|
93
|
+
*/
|
|
94
|
+
isPending: false;
|
|
95
|
+
/**
|
|
96
|
+
* Whether the promise is pending.
|
|
97
|
+
*
|
|
98
|
+
* @deprecated use `isPending` instead
|
|
99
|
+
* @typedoc
|
|
100
|
+
*/
|
|
101
|
+
isLoading: false;
|
|
102
|
+
/**
|
|
103
|
+
* Whether the promise has resolved
|
|
104
|
+
* successfully.
|
|
105
|
+
*
|
|
106
|
+
* @typedoc
|
|
107
|
+
*/
|
|
108
|
+
isSuccess: true;
|
|
109
|
+
/**
|
|
110
|
+
* Whether the promise has rejected
|
|
111
|
+
* with an error.
|
|
112
|
+
*
|
|
113
|
+
* @typedoc
|
|
114
|
+
*/
|
|
115
|
+
isError: false;
|
|
116
|
+
/**
|
|
117
|
+
* Once the promise has resolved, this will
|
|
118
|
+
* be the value the promise resolved to.
|
|
119
|
+
*
|
|
120
|
+
* @typedoc
|
|
121
|
+
*/
|
|
122
|
+
value: T;
|
|
123
|
+
/**
|
|
124
|
+
* Once the promise has resolved, this will
|
|
125
|
+
* be the value the promise resolved to.
|
|
126
|
+
*
|
|
127
|
+
* @deprecated use `value` instead
|
|
128
|
+
* @typedoc
|
|
129
|
+
*/
|
|
130
|
+
result: T;
|
|
131
|
+
/**
|
|
132
|
+
* Once the promise has rejected, this will
|
|
133
|
+
* be the error the promise rejected with.
|
|
134
|
+
*
|
|
135
|
+
*
|
|
136
|
+
* @deprecated use `reason` instead
|
|
137
|
+
* @typedoc
|
|
138
|
+
*/
|
|
139
|
+
error: null;
|
|
140
|
+
/**
|
|
141
|
+
* Once the promise has rejected, this will
|
|
142
|
+
* be the error the promise rejected with.
|
|
143
|
+
*
|
|
144
|
+
* @typedoc
|
|
145
|
+
*/
|
|
146
|
+
reason: null;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* The state of a promise in the "rejected" state.
|
|
150
|
+
* This is the state of a promise that has rejected
|
|
151
|
+
* with an error.
|
|
152
|
+
*
|
|
153
|
+
* @typedoc
|
|
154
|
+
*/
|
|
155
|
+
export interface RejectedPromise<E> {
|
|
156
|
+
/**
|
|
157
|
+
* The status of the promise.
|
|
158
|
+
*
|
|
159
|
+
* @typedoc
|
|
160
|
+
*/
|
|
161
|
+
status: 'rejected';
|
|
162
|
+
/**
|
|
163
|
+
* Whether the promise is pending.
|
|
164
|
+
*
|
|
165
|
+
* @typedoc
|
|
166
|
+
*/
|
|
167
|
+
isPending: false;
|
|
168
|
+
/**
|
|
169
|
+
* Whether the promise is pending.
|
|
170
|
+
*
|
|
171
|
+
* @deprecated use `isPending` instead
|
|
172
|
+
* @typedoc
|
|
173
|
+
*/
|
|
174
|
+
isLoading: false;
|
|
175
|
+
/**
|
|
176
|
+
* Whether the promise has resolved
|
|
177
|
+
* successfully.
|
|
178
|
+
*
|
|
179
|
+
* @typedoc
|
|
180
|
+
*/
|
|
181
|
+
isSuccess: false;
|
|
182
|
+
/**
|
|
183
|
+
* Whether the promise has rejected
|
|
184
|
+
* with an error.
|
|
185
|
+
*
|
|
186
|
+
* @typedoc
|
|
187
|
+
*/
|
|
188
|
+
isError: true;
|
|
189
|
+
/**
|
|
190
|
+
* Once the promise has resolved, this will
|
|
191
|
+
* be the value the promise resolved to.
|
|
192
|
+
*
|
|
193
|
+
* @typedoc
|
|
194
|
+
*/
|
|
195
|
+
value: null;
|
|
196
|
+
/**
|
|
197
|
+
* Once the promise has resolved, this will
|
|
198
|
+
* be the value the promise resolved to.
|
|
199
|
+
*
|
|
200
|
+
* @deprecated use `value` instead
|
|
201
|
+
* @typedoc
|
|
202
|
+
*/
|
|
203
|
+
result: null;
|
|
204
|
+
/**
|
|
205
|
+
* Once the promise has rejected, this will
|
|
206
|
+
* be the error the promise rejected with.
|
|
207
|
+
*
|
|
208
|
+
*
|
|
209
|
+
* @deprecated use `reason` instead
|
|
210
|
+
* @typedoc
|
|
211
|
+
*/
|
|
212
|
+
error: E;
|
|
213
|
+
/**
|
|
214
|
+
* Once the promise has rejected, this will
|
|
215
|
+
* be the error the promise rejected with.
|
|
216
|
+
*
|
|
217
|
+
* @typedoc
|
|
218
|
+
*/
|
|
219
|
+
reason: E;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* The state of a promise. This is the type that is returned
|
|
223
|
+
* from `getPromiseState`.
|
|
224
|
+
*
|
|
225
|
+
* See also:
|
|
226
|
+
* - {@link PendingPromise}
|
|
227
|
+
* - {@link ResolvedPromise}
|
|
228
|
+
* - {@link RejectedPromise}
|
|
229
|
+
*
|
|
230
|
+
* @typedoc
|
|
231
|
+
*/
|
|
232
|
+
export type PromiseState<T = unknown, E = unknown> = PendingPromise | ResolvedPromise<T> | RejectedPromise<E>;
|
|
233
|
+
export function createPromiseState<T, E>(promise: Promise<T> | Awaitable<T, E>): Readonly<PromiseState<T, E>>;
|
|
234
|
+
/**
|
|
235
|
+
* Returns a reactive state-machine for the provided promise or awaitable.
|
|
236
|
+
*
|
|
237
|
+
* Repeat calls to `getPromiseState` with the same promise will return the same state object
|
|
238
|
+
* making is safe and easy to use in templates and JavaScript code to produce reactive
|
|
239
|
+
* behaviors around promises.
|
|
240
|
+
*
|
|
241
|
+
* `getPromiseState` can be used in both JavaScript and Template contexts.
|
|
242
|
+
*
|
|
243
|
+
* ```ts
|
|
244
|
+
* import { getPromiseState } from '@warp-drive/ember';
|
|
245
|
+
*
|
|
246
|
+
* const state = getPromiseState(promise);
|
|
247
|
+
* ```
|
|
248
|
+
*
|
|
249
|
+
* For instance, we could write a getter on a component that updates whenever
|
|
250
|
+
* the promise state advances or the promise changes, by combining the function
|
|
251
|
+
* with the use of `@cached`
|
|
252
|
+
*
|
|
253
|
+
* ```ts
|
|
254
|
+
* class Component {
|
|
255
|
+
* @cached
|
|
256
|
+
* get title() {
|
|
257
|
+
* const state = getPromiseState(this.args.request);
|
|
258
|
+
* if (state.isPending) {
|
|
259
|
+
* return 'loading...';
|
|
260
|
+
* }
|
|
261
|
+
* if (state.isError) { return null; }
|
|
262
|
+
* return state.result.title;
|
|
263
|
+
* }
|
|
264
|
+
* }
|
|
265
|
+
* ```
|
|
266
|
+
*
|
|
267
|
+
* Or in a template as a helper:
|
|
268
|
+
*
|
|
269
|
+
* ```gjs
|
|
270
|
+
* import { getPromiseState } from '@warp-drive/ember';
|
|
271
|
+
*
|
|
272
|
+
* <template>
|
|
273
|
+
* {{#let (getPromiseState @request) as |state|}}
|
|
274
|
+
* {{#if state.isPending}} <Spinner />
|
|
275
|
+
* {{else if state.isError}} <ErrorForm @error={{state.error}} />
|
|
276
|
+
* {{else}}
|
|
277
|
+
* <h1>{{state.result.title}}</h1>
|
|
278
|
+
* {{/if}}
|
|
279
|
+
* {{/let}}
|
|
280
|
+
* </template>
|
|
281
|
+
* ```
|
|
282
|
+
*
|
|
283
|
+
* If looking to use in a template, consider also the `<Await />` component.
|
|
284
|
+
*
|
|
285
|
+
* @typedoc
|
|
286
|
+
*/
|
|
287
|
+
export function getPromiseState<T = unknown, E = unknown>(promise: Promise<T> | Awaitable<T, E>): Readonly<PromiseState<T, E>>;
|
|
288
|
+
}
|
|
289
|
+
//# sourceMappingURL=promise-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promise-state.d.ts","sourceRoot":"","sources":["../../../src/-private/new-core-tmp/promise-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAMrD;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,MAAM,EAAE,SAAS,CAAC;IAElB;;;;OAIG;IACH,SAAS,EAAE,IAAI,CAAC;IAEhB;;;;;OAKG;IACH,SAAS,EAAE,IAAI,CAAC;IAEhB;;;;;OAKG;IACH,SAAS,EAAE,KAAK,CAAC;IAEjB;;;;;OAKG;IACH,OAAO,EAAE,KAAK,CAAC;IAEf;;;;;OAKG;IACH,KAAK,EAAE,IAAI,CAAC;IACZ;;;;;;OAMG;IACH,MAAM,EAAE,IAAI,CAAC;IAEb;;;;;;;OAOG;IACH,KAAK,EAAE,IAAI,CAAC;IAEZ;;;;;OAKG;IACH,MAAM,EAAE,IAAI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,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CA4C5G;AAaD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAgB,eAAe,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,EACtD,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAU9B"}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
declare module '@ember-data/store/-private/new-core-tmp/request-state' {
|
|
2
|
+
import type { Future, ImmutableRequestInfo, ResponseInfo, StructuredErrorDocument } from '@ember-data/request';
|
|
3
|
+
import type { PendingPromise, RejectedPromise, ResolvedPromise } from '@ember-data/store/-private/new-core-tmp/promise-state';
|
|
4
|
+
/**
|
|
5
|
+
* Lazily consumes the stream of a request, providing a number of
|
|
6
|
+
* reactive properties that can be used to build UIs that respond
|
|
7
|
+
* to the progress of a request.
|
|
8
|
+
*
|
|
9
|
+
* @typedoc
|
|
10
|
+
*/
|
|
11
|
+
export class RequestLoadingState {
|
|
12
|
+
_sizeHint: number;
|
|
13
|
+
_bytesLoaded: number;
|
|
14
|
+
_startTime: number;
|
|
15
|
+
_endTime: number;
|
|
16
|
+
_lastPacketTime: number;
|
|
17
|
+
_isPending: boolean;
|
|
18
|
+
_isStarted: boolean;
|
|
19
|
+
_isComplete: boolean;
|
|
20
|
+
_isCancelled: boolean;
|
|
21
|
+
_isErrored: boolean;
|
|
22
|
+
_error: Error | null;
|
|
23
|
+
_stream: TransformStream | null;
|
|
24
|
+
_future: Future<unknown>;
|
|
25
|
+
_triggered: boolean;
|
|
26
|
+
_trigger(): void;
|
|
27
|
+
promise: Promise<void> | null;
|
|
28
|
+
get isPending(): boolean;
|
|
29
|
+
get sizeHint(): number;
|
|
30
|
+
get stream(): ReadableStream | null;
|
|
31
|
+
get isStarted(): boolean;
|
|
32
|
+
get bytesLoaded(): number;
|
|
33
|
+
get startTime(): number;
|
|
34
|
+
get endTime(): number;
|
|
35
|
+
get lastPacketTime(): number;
|
|
36
|
+
get isComplete(): boolean;
|
|
37
|
+
get isCancelled(): boolean;
|
|
38
|
+
get isErrored(): boolean;
|
|
39
|
+
get error(): Error | null;
|
|
40
|
+
get elapsedTime(): number;
|
|
41
|
+
get completedRatio(): number;
|
|
42
|
+
get remainingRatio(): number;
|
|
43
|
+
get duration(): number;
|
|
44
|
+
get speed(): number;
|
|
45
|
+
constructor(future: Future<unknown>);
|
|
46
|
+
abort: () => void;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The state of a request in the "pending"
|
|
50
|
+
* state. This is the default initial state.
|
|
51
|
+
*
|
|
52
|
+
* Extends the {@link PendingPromise} interface.
|
|
53
|
+
*
|
|
54
|
+
* @typedoc
|
|
55
|
+
*/
|
|
56
|
+
export interface PendingRequest extends PendingPromise {
|
|
57
|
+
/**
|
|
58
|
+
* Whether the request is cancelled.
|
|
59
|
+
*
|
|
60
|
+
* @typedoc
|
|
61
|
+
*/
|
|
62
|
+
isCancelled: false;
|
|
63
|
+
loadingState: RequestLoadingState;
|
|
64
|
+
request: null;
|
|
65
|
+
response: null;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The state of a request in the "fulfilled" state.
|
|
69
|
+
* This is the state of a request that has resolved
|
|
70
|
+
* successfully.
|
|
71
|
+
*
|
|
72
|
+
* Extends the {@link ResolvedPromise} interface.
|
|
73
|
+
*
|
|
74
|
+
* @typedoc
|
|
75
|
+
*/
|
|
76
|
+
export interface ResolvedRequest<T, RT> extends ResolvedPromise<RT> {
|
|
77
|
+
/**
|
|
78
|
+
* Whether the request is cancelled.
|
|
79
|
+
*
|
|
80
|
+
* @typedoc
|
|
81
|
+
*/
|
|
82
|
+
isCancelled: false;
|
|
83
|
+
loadingState: RequestLoadingState;
|
|
84
|
+
request: ImmutableRequestInfo<T, RT> | null;
|
|
85
|
+
response: Response | ResponseInfo | null;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The state of a request in the "rejected" state.
|
|
89
|
+
* This is the state of a request that has rejected
|
|
90
|
+
* with an error.
|
|
91
|
+
*
|
|
92
|
+
* Extends the {@link RejectedPromise} interface.
|
|
93
|
+
*
|
|
94
|
+
* @typedoc
|
|
95
|
+
*/
|
|
96
|
+
export interface RejectedRequest<T, RT, E extends StructuredErrorDocument = StructuredErrorDocument> extends RejectedPromise<E> {
|
|
97
|
+
/**
|
|
98
|
+
* Whether the request is cancelled.
|
|
99
|
+
*
|
|
100
|
+
* @typedoc
|
|
101
|
+
*/
|
|
102
|
+
isCancelled: false;
|
|
103
|
+
loadingState: RequestLoadingState;
|
|
104
|
+
request: ImmutableRequestInfo<T, RT> | null;
|
|
105
|
+
response: Response | ResponseInfo | null;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* The state of a request in the "cancelled" state.
|
|
109
|
+
* This is the state of a promise that has been
|
|
110
|
+
* cancelled.
|
|
111
|
+
*
|
|
112
|
+
* @typedoc
|
|
113
|
+
*/
|
|
114
|
+
export interface CancelledRequest<T, RT, E extends StructuredErrorDocument = StructuredErrorDocument> {
|
|
115
|
+
/**
|
|
116
|
+
* The status of the request.
|
|
117
|
+
*
|
|
118
|
+
* @typedoc
|
|
119
|
+
*/
|
|
120
|
+
status: 'cancelled';
|
|
121
|
+
/**
|
|
122
|
+
* Whether the request is pending.
|
|
123
|
+
*
|
|
124
|
+
* @typedoc
|
|
125
|
+
*/
|
|
126
|
+
isPending: false;
|
|
127
|
+
/**
|
|
128
|
+
* Whether the request is pending.
|
|
129
|
+
*
|
|
130
|
+
* @typedoc
|
|
131
|
+
*/
|
|
132
|
+
isLoading: false;
|
|
133
|
+
/**
|
|
134
|
+
* Whether the request has resolved
|
|
135
|
+
* successfully.
|
|
136
|
+
*
|
|
137
|
+
* @typedoc
|
|
138
|
+
*/
|
|
139
|
+
isSuccess: false;
|
|
140
|
+
/**
|
|
141
|
+
* Whether the request has rejected
|
|
142
|
+
* with an error.
|
|
143
|
+
*
|
|
144
|
+
* @typedoc
|
|
145
|
+
*/
|
|
146
|
+
isError: true;
|
|
147
|
+
/**
|
|
148
|
+
* Once the request has resolved, this will
|
|
149
|
+
* be the value the request resolved to.
|
|
150
|
+
*
|
|
151
|
+
* @typedoc
|
|
152
|
+
*/
|
|
153
|
+
value: null;
|
|
154
|
+
/**
|
|
155
|
+
* Once the request has resolved, this will
|
|
156
|
+
* be the value the request resolved to.
|
|
157
|
+
*
|
|
158
|
+
* @deprecated use `value` instead
|
|
159
|
+
* @typedoc
|
|
160
|
+
*/
|
|
161
|
+
result: null;
|
|
162
|
+
/**
|
|
163
|
+
* Once the request has rejected, this will
|
|
164
|
+
* be the error the request rejected with.
|
|
165
|
+
*
|
|
166
|
+
*
|
|
167
|
+
* @deprecated use `reason` instead
|
|
168
|
+
* @typedoc
|
|
169
|
+
*/
|
|
170
|
+
error: E;
|
|
171
|
+
/**
|
|
172
|
+
* Once the request has rejected, this will
|
|
173
|
+
* be the error the request rejected with.
|
|
174
|
+
*
|
|
175
|
+
* @typedoc
|
|
176
|
+
*/
|
|
177
|
+
reason: E;
|
|
178
|
+
/**
|
|
179
|
+
* Whether the request is cancelled.
|
|
180
|
+
*
|
|
181
|
+
* @typedoc
|
|
182
|
+
*/
|
|
183
|
+
isCancelled: true;
|
|
184
|
+
loadingState: RequestLoadingState;
|
|
185
|
+
request: ImmutableRequestInfo<T, RT> | null;
|
|
186
|
+
response: Response | ResponseInfo | null;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* RequestState extends the concept of PromiseState to provide a reactive
|
|
190
|
+
* wrapper for a request `Future` which allows you write declarative code
|
|
191
|
+
* around a Future's control flow.
|
|
192
|
+
*
|
|
193
|
+
* It is useful in both Template and JavaScript contexts, allowing you
|
|
194
|
+
* to quickly derive behaviors and data from pending, error and success
|
|
195
|
+
* states.
|
|
196
|
+
*
|
|
197
|
+
* The key difference between a Promise and a Future is that Futures provide
|
|
198
|
+
* access to a stream of their content, the identity of the request (if any)
|
|
199
|
+
* as well as the ability to attempt to abort the request.
|
|
200
|
+
*
|
|
201
|
+
* ```ts
|
|
202
|
+
* interface Future<T> extends Promise<T>> {
|
|
203
|
+
* getStream(): Promise<ReadableStream>;
|
|
204
|
+
* abort(): void;
|
|
205
|
+
* lid: StableDocumentIdentifier | null;
|
|
206
|
+
* }
|
|
207
|
+
* ```
|
|
208
|
+
*
|
|
209
|
+
* These additional APIs allow us to craft even richer state experiences.
|
|
210
|
+
*
|
|
211
|
+
* To get the state of a request, use `getRequestState`.
|
|
212
|
+
*
|
|
213
|
+
* See also:
|
|
214
|
+
* - {@link PendingRequest}
|
|
215
|
+
* - {@link ResolvedRequest}
|
|
216
|
+
* - {@link RejectedRequest}
|
|
217
|
+
* - {@link CancelledRequest}
|
|
218
|
+
*
|
|
219
|
+
* @typedoc
|
|
220
|
+
*/
|
|
221
|
+
export type RequestCacheRequestState<T = unknown, RT = unknown, E extends StructuredErrorDocument = StructuredErrorDocument> = PendingRequest | ResolvedRequest<T, RT> | RejectedRequest<T, RT, E> | CancelledRequest<T, RT, E>;
|
|
222
|
+
export function createRequestState<T, RT, E>(future: Future<RT>): Readonly<RequestCacheRequestState<T, RT, StructuredErrorDocument<E>>>;
|
|
223
|
+
/**
|
|
224
|
+
* `getRequestState` can be used in both JavaScript and Template contexts.
|
|
225
|
+
*
|
|
226
|
+
* ```ts
|
|
227
|
+
* import { getRequestState } from '@warp-drive/ember';
|
|
228
|
+
*
|
|
229
|
+
* const state = getRequestState(future);
|
|
230
|
+
* ```
|
|
231
|
+
*
|
|
232
|
+
* For instance, we could write a getter on a component that updates whenever
|
|
233
|
+
* the request state advances or the future changes, by combining the function
|
|
234
|
+
* with the use of `@cached`
|
|
235
|
+
*
|
|
236
|
+
* ```ts
|
|
237
|
+
* class Component {
|
|
238
|
+
* @cached
|
|
239
|
+
* get title() {
|
|
240
|
+
* const state = getRequestState(this.args.request);
|
|
241
|
+
* if (state.isPending) {
|
|
242
|
+
* return 'loading...';
|
|
243
|
+
* }
|
|
244
|
+
* if (state.isError) { return null; }
|
|
245
|
+
* return state.result.title;
|
|
246
|
+
* }
|
|
247
|
+
* }
|
|
248
|
+
* ```
|
|
249
|
+
*
|
|
250
|
+
* Or in a template as a helper:
|
|
251
|
+
*
|
|
252
|
+
* ```gjs
|
|
253
|
+
* import { getRequestState } from '@warp-drive/ember';
|
|
254
|
+
*
|
|
255
|
+
* <template>
|
|
256
|
+
* {{#let (getRequestState @request) as |state|}}
|
|
257
|
+
* {{#if state.isPending}}
|
|
258
|
+
* <Spinner />
|
|
259
|
+
* {{else if state.isError}}
|
|
260
|
+
* <ErrorForm @error={{state.error}} />
|
|
261
|
+
* {{else}}
|
|
262
|
+
* <h1>{{state.result.title}}</h1>
|
|
263
|
+
* {{/if}}
|
|
264
|
+
* {{/let}}
|
|
265
|
+
* </template>
|
|
266
|
+
* ```
|
|
267
|
+
*
|
|
268
|
+
* If looking to use in a template, consider also the `<Request />` component
|
|
269
|
+
* which offers a numbe of additional capabilities for requests *beyond* what
|
|
270
|
+
* `RequestState` provides.
|
|
271
|
+
*
|
|
272
|
+
* @typedoc
|
|
273
|
+
*/
|
|
274
|
+
export function getRequestState<RT, T, E>(future: Future<RT>): Readonly<RequestCacheRequestState<T, RT, StructuredErrorDocument<E>>>;
|
|
275
|
+
}
|
|
276
|
+
//# sourceMappingURL=request-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-state.d.ts","sourceRoot":"","sources":["../../../src/-private/new-core-tmp/request-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,MAAM,EACN,oBAAoB,EACpB,YAAY,EAEZ,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAI7B,O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jB,QAAQ,CAAC,wBAAwB,CAAC,CAAC,EAAE,EAAE,EAAE,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC,CASvE"}
|
|
@@ -10,7 +10,7 @@ declare module '@ember-data/store/-private' {
|
|
|
10
10
|
export { constructResource } from '@ember-data/store/-private/utils/construct-resource';
|
|
11
11
|
export type { ReactiveDocument as Document } from '@ember-data/store/-private/document';
|
|
12
12
|
export type { InstanceCache } from '@ember-data/store/-private/caches/instance-cache';
|
|
13
|
-
export type { FindRecordQuery, Request, SaveRecordMutation,
|
|
13
|
+
export type { FindRecordQuery, Request, SaveRecordMutation, RequestCacheRequestState, RequestStateService, } from '@ember-data/store/-private/network/request-cache';
|
|
14
14
|
export type { CreateRecordProperties } from '@ember-data/store/-private/store-service';
|
|
15
15
|
export { coerceId, ensureStringId } from '@ember-data/store/-private/utils/coerce-id';
|
|
16
16
|
export type { NativeProxy } from '@ember-data/store/-private/record-arrays/native-proxy-type-fix';
|
|
@@ -24,5 +24,7 @@ declare module '@ember-data/store/-private' {
|
|
|
24
24
|
export type { StoreRequestInput } from '@ember-data/store/-private/cache-handler/handler';
|
|
25
25
|
export { RelatedCollection } from '@ember-data/store/-private/record-arrays/many-array';
|
|
26
26
|
export { log, logGroup } from '@ember-data/store/-private/debug/utils';
|
|
27
|
+
export { getPromiseState, type PromiseState } from '@ember-data/store/-private/new-core-tmp/promise-state';
|
|
28
|
+
export { getRequestState, type RequestLoadingState, type RequestCacheRequestState as RequestState, } from '@ember-data/store/-private/new-core-tmp/request-state';
|
|
27
29
|
}
|
|
28
30
|
//# sourceMappingURL=-private.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"-private.d.ts","sourceRoot":"","sources":["../src/-private.ts"],"names":[],"mappings":"AAAA;;EAEE;AAEF,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AA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AE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAClF,OAAO,EACL,eAAe,IAAI,SAAS,EAC5B,UAAU,IAAI,qBAAqB,EACnC,WAAW,EACX,MAAM,EACN,MAAM,EACN,YAAY,GACb,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AAGxF,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAG/E,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,IAAI,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AACpG,YAAY,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAExE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAC3F,OAAO,EACL,eAAe,EACf,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,IAAI,YAAY,GAC9C,MAAM,uCAAuC,CAAC"}
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
/// <reference path="./-private/cache-handler/utils.d.ts" />
|
|
21
21
|
/// <reference path="./-private/cache-handler/handler.d.ts" />
|
|
22
22
|
/// <reference path="./-private/cache-handler/types.d.ts" />
|
|
23
|
+
/// <reference path="./-private/new-core-tmp/promise-state.d.ts" />
|
|
24
|
+
/// <reference path="./-private/new-core-tmp/request-state.d.ts" />
|
|
23
25
|
/// <reference path="./-private/network/request-cache.d.ts" />
|
|
24
26
|
/// <reference path="./-private/legacy-model-support/record-reference.d.ts" />
|
|
25
27
|
/// <reference path="./-private/legacy-model-support/shim-model-class.d.ts" />
|