@warp-drive/core 5.7.0-alpha.16 → 5.7.0-alpha.18
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/declarations/reactive/-private/document.d.ts +5 -5
- package/declarations/request/-private/manager.d.ts +1 -4
- package/declarations/store/-private/cache-handler/handler.d.ts +2 -8
- package/declarations/store/-private/new-core-tmp/request-state.d.ts +14 -21
- package/declarations/store/-private/new-core-tmp/request-subscription.d.ts +4 -8
- package/declarations/store/-private/store-service.d.ts +1 -4
- package/declarations/types/request.d.ts +15 -24
- package/dist/index.js +1 -1
- package/dist/reactive.js +2 -2
- package/dist/{request-state-CQ0Q6d1V.js → request-state-0_fVMu9R.js} +7 -7
- package/dist/store/-private.js +1 -1
- package/dist/types/-private.js +1 -1
- package/package.json +3 -3
|
@@ -79,7 +79,7 @@ export declare class ReactiveDocument<T> {
|
|
|
79
79
|
* @param {Object} options
|
|
80
80
|
* @return {Promise<Document>}
|
|
81
81
|
*/
|
|
82
|
-
fetch(options?: RequestInfo<ReactiveDocument<T
|
|
82
|
+
fetch(options?: RequestInfo<ReactiveDocument<T>>): Promise<ReactiveDocument<T>>;
|
|
83
83
|
/**
|
|
84
84
|
* Fetches the next link for this document, returning a promise that resolves
|
|
85
85
|
* with the new document when the request completes, or null if there is no
|
|
@@ -89,7 +89,7 @@ export declare class ReactiveDocument<T> {
|
|
|
89
89
|
* @param {Object} options
|
|
90
90
|
* @return {Promise<Document | null>}
|
|
91
91
|
*/
|
|
92
|
-
next(options?: RequestInfo<ReactiveDocument<T
|
|
92
|
+
next(options?: RequestInfo<ReactiveDocument<T>>): Promise<ReactiveDocument<T> | null>;
|
|
93
93
|
/**
|
|
94
94
|
* Fetches the prev link for this document, returning a promise that resolves
|
|
95
95
|
* with the new document when the request completes, or null if there is no
|
|
@@ -99,7 +99,7 @@ export declare class ReactiveDocument<T> {
|
|
|
99
99
|
* @param {Object} options
|
|
100
100
|
* @return {Promise<Document | null>}
|
|
101
101
|
*/
|
|
102
|
-
prev(options: RequestInfo<ReactiveDocument<T
|
|
102
|
+
prev(options: RequestInfo<ReactiveDocument<T>>): Promise<ReactiveDocument<T> | null>;
|
|
103
103
|
/**
|
|
104
104
|
* Fetches the first link for this document, returning a promise that resolves
|
|
105
105
|
* with the new document when the request completes, or null if there is no
|
|
@@ -109,7 +109,7 @@ export declare class ReactiveDocument<T> {
|
|
|
109
109
|
* @param {Object} options
|
|
110
110
|
* @return {Promise<Document | null>}
|
|
111
111
|
*/
|
|
112
|
-
first(options: RequestInfo<ReactiveDocument<T
|
|
112
|
+
first(options: RequestInfo<ReactiveDocument<T>>): Promise<ReactiveDocument<T> | null>;
|
|
113
113
|
/**
|
|
114
114
|
* Fetches the last link for this document, returning a promise that resolves
|
|
115
115
|
* with the new document when the request completes, or null if there is no
|
|
@@ -119,7 +119,7 @@ export declare class ReactiveDocument<T> {
|
|
|
119
119
|
* @param {Object} options
|
|
120
120
|
* @return {Promise<Document | null>}
|
|
121
121
|
*/
|
|
122
|
-
last(options: RequestInfo<ReactiveDocument<T
|
|
122
|
+
last(options: RequestInfo<ReactiveDocument<T>>): Promise<ReactiveDocument<T> | null>;
|
|
123
123
|
/**
|
|
124
124
|
* Implemented for `JSON.stringify` support.
|
|
125
125
|
*
|
|
@@ -145,10 +145,7 @@ export declare class RequestManager {
|
|
|
145
145
|
* @param {RequestInfo} request
|
|
146
146
|
* @return {Future}
|
|
147
147
|
*/
|
|
148
|
-
request<
|
|
149
|
-
RT,
|
|
150
|
-
T = unknown
|
|
151
|
-
>(request: RequestInfo<RT, T>): Future<RT>;
|
|
148
|
+
request<RT>(request: RequestInfo<RT>): Future<RT>;
|
|
152
149
|
/**
|
|
153
150
|
* This method exists so that the RequestManager can be created
|
|
154
151
|
* can be created by container/factory systems that expect to
|
|
@@ -3,17 +3,11 @@ import type { ImmutableRequestInfo, RequestContext } from "../../../types/reques
|
|
|
3
3
|
import type { ResourceIdentifierObject } from "../../../types/spec/json-api-raw.js";
|
|
4
4
|
import type { RequestSignature } from "../../../types/symbols.js";
|
|
5
5
|
import type { Store } from "../store-service.js";
|
|
6
|
-
export type LooseStoreRequestInfo<
|
|
7
|
-
RT = unknown,
|
|
8
|
-
T = unknown
|
|
9
|
-
> = Omit<ImmutableRequestInfo<RT, T>, "records" | "headers" | typeof RequestSignature> & {
|
|
6
|
+
export type LooseStoreRequestInfo<RT = unknown> = Omit<ImmutableRequestInfo<RT>, "records" | "headers" | typeof RequestSignature> & {
|
|
10
7
|
records?: ResourceIdentifierObject[];
|
|
11
8
|
headers?: Headers;
|
|
12
9
|
};
|
|
13
|
-
export type StoreRequestInput<
|
|
14
|
-
RT = unknown,
|
|
15
|
-
T = unknown
|
|
16
|
-
> = ImmutableRequestInfo<RT, T> | LooseStoreRequestInfo<RT, T>;
|
|
10
|
+
export type StoreRequestInput<RT = unknown> = ImmutableRequestInfo<RT> | LooseStoreRequestInfo<RT>;
|
|
17
11
|
export interface StoreRequestContext extends RequestContext {
|
|
18
12
|
request: ImmutableRequestInfo & {
|
|
19
13
|
store: Store;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Future } from "../../../request.js";
|
|
2
2
|
import type { ImmutableRequestInfo, ResponseInfo, StructuredErrorDocument } from "../../../types/request.js";
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3
4
|
import type { PendingPromise, RejectedPromise, ResolvedPromise } from "./promise-state.js";
|
|
4
5
|
/**
|
|
5
6
|
* Lazily consumes the stream of a request, providing a number of
|
|
@@ -69,17 +70,14 @@ export interface PendingRequest extends PendingPromise {
|
|
|
69
70
|
* Extends the {@link ResolvedPromise} interface.
|
|
70
71
|
*
|
|
71
72
|
*/
|
|
72
|
-
export interface ResolvedRequest<
|
|
73
|
-
RT,
|
|
74
|
-
T
|
|
75
|
-
> extends ResolvedPromise<RT> {
|
|
73
|
+
export interface ResolvedRequest<RT> extends ResolvedPromise<RT> {
|
|
76
74
|
/**
|
|
77
75
|
* Whether the request is cancelled.
|
|
78
76
|
*
|
|
79
77
|
*/
|
|
80
78
|
isCancelled: false;
|
|
81
79
|
loadingState: RequestLoadingState;
|
|
82
|
-
request: ImmutableRequestInfo<RT
|
|
80
|
+
request: ImmutableRequestInfo<RT> | null;
|
|
83
81
|
response: Response | ResponseInfo | null;
|
|
84
82
|
}
|
|
85
83
|
/**
|
|
@@ -92,7 +90,6 @@ export interface ResolvedRequest<
|
|
|
92
90
|
*/
|
|
93
91
|
export interface RejectedRequest<
|
|
94
92
|
RT,
|
|
95
|
-
T,
|
|
96
93
|
E extends StructuredErrorDocument = StructuredErrorDocument
|
|
97
94
|
> extends RejectedPromise<E> {
|
|
98
95
|
/**
|
|
@@ -101,7 +98,7 @@ export interface RejectedRequest<
|
|
|
101
98
|
*/
|
|
102
99
|
isCancelled: false;
|
|
103
100
|
loadingState: RequestLoadingState;
|
|
104
|
-
request: ImmutableRequestInfo<RT
|
|
101
|
+
request: ImmutableRequestInfo<RT> | null;
|
|
105
102
|
response: Response | ResponseInfo | null;
|
|
106
103
|
}
|
|
107
104
|
/**
|
|
@@ -112,7 +109,6 @@ export interface RejectedRequest<
|
|
|
112
109
|
*/
|
|
113
110
|
export interface CancelledRequest<
|
|
114
111
|
RT,
|
|
115
|
-
T,
|
|
116
112
|
E extends StructuredErrorDocument = StructuredErrorDocument
|
|
117
113
|
> {
|
|
118
114
|
/**
|
|
@@ -175,21 +171,21 @@ export interface CancelledRequest<
|
|
|
175
171
|
*/
|
|
176
172
|
isCancelled: true;
|
|
177
173
|
loadingState: RequestLoadingState;
|
|
178
|
-
request: ImmutableRequestInfo<RT
|
|
174
|
+
request: ImmutableRequestInfo<RT> | null;
|
|
179
175
|
response: Response | ResponseInfo | null;
|
|
180
176
|
}
|
|
181
177
|
/**
|
|
182
|
-
* RequestState extends the concept of PromiseState to provide a reactive
|
|
183
|
-
* wrapper for a request
|
|
178
|
+
* RequestState extends the concept of {@link PromiseState} to provide a reactive
|
|
179
|
+
* wrapper for a request {@link Future} which allows you write declarative code
|
|
184
180
|
* around a Future's control flow.
|
|
185
181
|
*
|
|
186
182
|
* It is useful in both Template and JavaScript contexts, allowing you
|
|
187
183
|
* to quickly derive behaviors and data from pending, error and success
|
|
188
184
|
* states.
|
|
189
185
|
*
|
|
190
|
-
* The key difference between a Promise and a Future is that Futures provide
|
|
191
|
-
* access to a stream of their content, the
|
|
192
|
-
* as well as the ability to attempt to abort the request.
|
|
186
|
+
* The key difference between a {@link Promise} and a Future is that Futures provide
|
|
187
|
+
* access to a {@link ReadableStream | stream} of their content, the {@link RequestKey} of the request (if any)
|
|
188
|
+
* as well as the ability to attempt to {@link Future.abort | abort} the request.
|
|
193
189
|
*
|
|
194
190
|
* ```ts
|
|
195
191
|
* interface Future<T> extends Promise<T>> {
|
|
@@ -201,7 +197,7 @@ export interface CancelledRequest<
|
|
|
201
197
|
*
|
|
202
198
|
* These additional APIs allow us to craft even richer state experiences.
|
|
203
199
|
*
|
|
204
|
-
* To get the state of a request, use
|
|
200
|
+
* To get the state of a request, use {@link getRequestState}.
|
|
205
201
|
*
|
|
206
202
|
* See also:
|
|
207
203
|
* - {@link PendingRequest}
|
|
@@ -212,14 +208,12 @@ export interface CancelledRequest<
|
|
|
212
208
|
*/
|
|
213
209
|
export type RequestCacheRequestState<
|
|
214
210
|
RT = unknown,
|
|
215
|
-
T = unknown,
|
|
216
211
|
E extends StructuredErrorDocument = StructuredErrorDocument
|
|
217
|
-
> = PendingRequest | ResolvedRequest<RT
|
|
212
|
+
> = PendingRequest | ResolvedRequest<RT> | RejectedRequest<RT, E> | CancelledRequest<RT, E>;
|
|
218
213
|
export declare function createRequestState<
|
|
219
214
|
RT,
|
|
220
|
-
T,
|
|
221
215
|
E
|
|
222
|
-
>(future: Future<RT>): Readonly<RequestCacheRequestState<RT,
|
|
216
|
+
>(future: Future<RT>): Readonly<RequestCacheRequestState<RT, StructuredErrorDocument<E>>>;
|
|
223
217
|
/**
|
|
224
218
|
* `getRequestState` can be used in both JavaScript and Template contexts.
|
|
225
219
|
*
|
|
@@ -272,6 +266,5 @@ export declare function createRequestState<
|
|
|
272
266
|
*/
|
|
273
267
|
export declare function getRequestState<
|
|
274
268
|
RT,
|
|
275
|
-
T,
|
|
276
269
|
E
|
|
277
|
-
>(future: Future<RT>): Readonly<RequestCacheRequestState<RT,
|
|
270
|
+
>(future: Future<RT>): Readonly<RequestCacheRequestState<RT, StructuredErrorDocument<E>>>;
|
|
@@ -22,7 +22,6 @@ type ContentFeatures<RT> = {
|
|
|
22
22
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
23
23
|
export interface SubscriptionArgs<
|
|
24
24
|
RT,
|
|
25
|
-
T,
|
|
26
25
|
E
|
|
27
26
|
> {
|
|
28
27
|
/**
|
|
@@ -37,7 +36,7 @@ export interface SubscriptionArgs<
|
|
|
37
36
|
* like the component to also initiate the request.
|
|
38
37
|
*
|
|
39
38
|
*/
|
|
40
|
-
query?: StoreRequestInput<RT
|
|
39
|
+
query?: StoreRequestInput<RT>;
|
|
41
40
|
/**
|
|
42
41
|
* The autorefresh behavior for the request. This can be a boolean, or any
|
|
43
42
|
* combination of the following values: `'online'`, `'interval'`, `'invalid'`.
|
|
@@ -80,7 +79,6 @@ export interface SubscriptionArgs<
|
|
|
80
79
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
81
80
|
export interface RequestSubscription<
|
|
82
81
|
RT,
|
|
83
|
-
T,
|
|
84
82
|
E
|
|
85
83
|
> {
|
|
86
84
|
/**
|
|
@@ -96,7 +94,6 @@ export interface RequestSubscription<
|
|
|
96
94
|
*/
|
|
97
95
|
export declare class RequestSubscription<
|
|
98
96
|
RT,
|
|
99
|
-
T,
|
|
100
97
|
E
|
|
101
98
|
> {
|
|
102
99
|
/**
|
|
@@ -183,7 +180,7 @@ export declare class RequestSubscription<
|
|
|
183
180
|
private _args;
|
|
184
181
|
/** @internal */
|
|
185
182
|
store: Store | RequestManager;
|
|
186
|
-
constructor(store: Store | RequestManager, args: SubscriptionArgs<RT,
|
|
183
|
+
constructor(store: Store | RequestManager, args: SubscriptionArgs<RT, E>);
|
|
187
184
|
/**
|
|
188
185
|
* @internal
|
|
189
186
|
*/
|
|
@@ -250,12 +247,11 @@ export declare class RequestSubscription<
|
|
|
250
247
|
*/
|
|
251
248
|
get _request(): Future<RT>;
|
|
252
249
|
get request(): Future<RT>;
|
|
253
|
-
get reqState(): RequestState<RT,
|
|
250
|
+
get reqState(): RequestState<RT, StructuredErrorDocument<E>>;
|
|
254
251
|
get result(): RT;
|
|
255
252
|
}
|
|
256
253
|
export declare function createRequestSubscription<
|
|
257
254
|
RT,
|
|
258
|
-
T,
|
|
259
255
|
E
|
|
260
|
-
>(store: Store | RequestManager, args: SubscriptionArgs<RT,
|
|
256
|
+
>(store: Store | RequestManager, args: SubscriptionArgs<RT, E>): RequestSubscription<RT, E>;
|
|
261
257
|
export {};
|
|
@@ -509,10 +509,7 @@ export declare class Store extends BaseClass {
|
|
|
509
509
|
*
|
|
510
510
|
* @public
|
|
511
511
|
*/
|
|
512
|
-
request<
|
|
513
|
-
RT,
|
|
514
|
-
T = unknown
|
|
515
|
-
>(requestConfig: StoreRequestInput<RT, T>): Future<RT>;
|
|
512
|
+
request<RT>(requestConfig: StoreRequestInput<RT>): Future<RT>;
|
|
516
513
|
/**
|
|
517
514
|
Creates a new record in the current store.
|
|
518
515
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ResourceKey } from "./identifier.js";
|
|
2
2
|
import type { QueryParamsSerializationOptions } from "./params.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { TypeFromInstanceOrString } from "./record.js";
|
|
4
4
|
import type { ResourceIdentifierObject } from "./spec/json-api-raw.js";
|
|
5
5
|
import type { RequestSignature } from "./symbols.js";
|
|
6
6
|
type Store = unknown;
|
|
@@ -13,7 +13,7 @@ export type HTTPMethod = "QUERY" | "GET" | "OPTIONS" | "POST" | "PUT" | "PATCH"
|
|
|
13
13
|
* Use these options to adjust CacheHandler behavior for a request.
|
|
14
14
|
*
|
|
15
15
|
*/
|
|
16
|
-
export type CacheOptions
|
|
16
|
+
export type CacheOptions = {
|
|
17
17
|
/**
|
|
18
18
|
* A key that uniquely identifies this request. If not present, the url wil be used
|
|
19
19
|
* as the key for any GET request, while all other requests will not be cached.
|
|
@@ -47,7 +47,10 @@ export type CacheOptions<T = unknown> = {
|
|
|
47
47
|
* than to invalidate findRecord requests for one.
|
|
48
48
|
*
|
|
49
49
|
*/
|
|
50
|
-
|
|
50
|
+
// TODO: Ideally this would be T extends TypedRecordInstance ? ExtractSuggestedCacheTypes<T>[] : string[];
|
|
51
|
+
// but that leads to `Type instantiation is excessively deep and possibly infinite.`
|
|
52
|
+
// issues when `T` has many properties.
|
|
53
|
+
types?: string[];
|
|
51
54
|
/**
|
|
52
55
|
* If true, the request will never be handled by the cache-manager and thus
|
|
53
56
|
* will never resolve from cache nor update the cache.
|
|
@@ -65,31 +68,25 @@ export type FindRecordRequestOptions<
|
|
|
65
68
|
url: string;
|
|
66
69
|
method: "GET";
|
|
67
70
|
headers: Headers;
|
|
68
|
-
cacheOptions?: CacheOptions
|
|
71
|
+
cacheOptions?: CacheOptions;
|
|
69
72
|
op: "findRecord";
|
|
70
73
|
records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];
|
|
71
74
|
[RequestSignature]?: RT;
|
|
72
75
|
};
|
|
73
|
-
export type QueryRequestOptions<
|
|
74
|
-
RT = unknown,
|
|
75
|
-
T = unknown
|
|
76
|
-
> = {
|
|
76
|
+
export type QueryRequestOptions<RT = unknown> = {
|
|
77
77
|
url: string;
|
|
78
78
|
method: "GET";
|
|
79
79
|
headers: Headers;
|
|
80
|
-
cacheOptions?: CacheOptions
|
|
80
|
+
cacheOptions?: CacheOptions;
|
|
81
81
|
op: "query";
|
|
82
82
|
[RequestSignature]?: RT;
|
|
83
83
|
};
|
|
84
|
-
export type PostQueryRequestOptions<
|
|
85
|
-
RT = unknown,
|
|
86
|
-
T = unknown
|
|
87
|
-
> = {
|
|
84
|
+
export type PostQueryRequestOptions<RT = unknown> = {
|
|
88
85
|
url: string;
|
|
89
86
|
method: "POST" | "QUERY";
|
|
90
87
|
headers: Headers;
|
|
91
88
|
body?: string | BodyInit | FormData;
|
|
92
|
-
cacheOptions: CacheOptions
|
|
89
|
+
cacheOptions: CacheOptions & {
|
|
93
90
|
key: string;
|
|
94
91
|
};
|
|
95
92
|
op: "query";
|
|
@@ -271,10 +268,7 @@ export interface ImmutableHeaders extends Headers {
|
|
|
271
268
|
* properties specific to the RequestManager's capabilities.
|
|
272
269
|
*
|
|
273
270
|
*/
|
|
274
|
-
export interface RequestInfo<
|
|
275
|
-
RT = unknown,
|
|
276
|
-
T = unknown
|
|
277
|
-
> extends Request {
|
|
271
|
+
export interface RequestInfo<RT = unknown> extends Request {
|
|
278
272
|
/**
|
|
279
273
|
* If provided, used instead of the AbortController auto-configured for each request by the RequestManager
|
|
280
274
|
*
|
|
@@ -283,7 +277,7 @@ export interface RequestInfo<
|
|
|
283
277
|
/**
|
|
284
278
|
* @see {@link CacheOptions}
|
|
285
279
|
*/
|
|
286
|
-
cacheOptions?: CacheOptions
|
|
280
|
+
cacheOptions?: CacheOptions;
|
|
287
281
|
store?: Store;
|
|
288
282
|
op?: string;
|
|
289
283
|
/**
|
|
@@ -316,11 +310,8 @@ export interface RequestInfo<
|
|
|
316
310
|
* Immutable version of {@link RequestInfo}. This is what is passed to handlers.
|
|
317
311
|
*
|
|
318
312
|
*/
|
|
319
|
-
export type ImmutableRequestInfo<
|
|
320
|
-
|
|
321
|
-
T = unknown
|
|
322
|
-
> = Readonly<Omit<RequestInfo<RT, T>, "controller">> & {
|
|
323
|
-
readonly cacheOptions?: Readonly<CacheOptions<T>>;
|
|
313
|
+
export type ImmutableRequestInfo<RT = unknown> = Readonly<Omit<RequestInfo<RT>, "controller">> & {
|
|
314
|
+
readonly cacheOptions?: Readonly<CacheOptions>;
|
|
324
315
|
readonly headers?: ImmutableHeaders;
|
|
325
316
|
readonly data?: Readonly<Record<string, unknown>>;
|
|
326
317
|
readonly options?: Readonly<Record<string, unknown>>;
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { a as cloneResponseProperties, I as IS_CACHE_HANDLER, b as assertValidRe
|
|
|
3
3
|
import { macroCondition, getGlobalConfig } from '@embroider/macros';
|
|
4
4
|
import { w as waitFor } from "./configure-B48bFHOl.js";
|
|
5
5
|
import { peekUniversalTransient, setUniversalTransient } from './types/-private.js';
|
|
6
|
-
export { C as CacheHandler, S as Store, r as recordIdentifierFor, M as setIdentifierForgetMethod, K as setIdentifierGenerationMethod, N as setIdentifierResetMethod, L as setIdentifierUpdateMethod, O as setKeyInfoForResource, s as storeFor } from "./request-state-
|
|
6
|
+
export { C as CacheHandler, S as Store, r as recordIdentifierFor, M as setIdentifierForgetMethod, K as setIdentifierGenerationMethod, N as setIdentifierResetMethod, L as setIdentifierUpdateMethod, O as setKeyInfoForResource, s as storeFor } from "./request-state-0_fVMu9R.js";
|
|
7
7
|
import '@ember/debug';
|
|
8
8
|
import './utils/string.js';
|
|
9
9
|
import "./symbols-sql1_mdx.js";
|
package/dist/reactive.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as ReactiveResource, G as isNonIdentityCacheableField, H as getFieldCacheKeyStrict, r as recordIdentifierFor, z as withSignalStore } from "./request-state-
|
|
2
|
-
export { I as checkout, J as commit } from "./request-state-
|
|
1
|
+
import { F as ReactiveResource, G as isNonIdentityCacheableField, H as getFieldCacheKeyStrict, r as recordIdentifierFor, z as withSignalStore } from "./request-state-0_fVMu9R.js";
|
|
2
|
+
export { I as checkout, J as commit } from "./request-state-0_fVMu9R.js";
|
|
3
3
|
import { isResourceSchema } from './types/schema/fields.js';
|
|
4
4
|
import { D as Destroy, C as Context } from "./symbols-sql1_mdx.js";
|
|
5
5
|
export { a as Checkout } from "./symbols-sql1_mdx.js";
|
|
@@ -9445,7 +9445,7 @@ class RequestSubscription {
|
|
|
9445
9445
|
}
|
|
9446
9446
|
})(!request.store || request.store === this.store) : {};
|
|
9447
9447
|
const store = request.store || this.store;
|
|
9448
|
-
const requester = wasStoreRequest && 'requestManager' in store ? store.requestManager : store;
|
|
9448
|
+
const requester = !wasStoreRequest && 'requestManager' in store ? store.requestManager : store;
|
|
9449
9449
|
this._isUpdating = true;
|
|
9450
9450
|
this._latestRequest = requester.request(request);
|
|
9451
9451
|
if (val !== 'refresh') {
|
|
@@ -9839,17 +9839,17 @@ defineNonEnumerableSignal(RequestLoadingState.prototype, '_lastPacketTime', 0);
|
|
|
9839
9839
|
*/
|
|
9840
9840
|
|
|
9841
9841
|
/**
|
|
9842
|
-
* RequestState extends the concept of PromiseState to provide a reactive
|
|
9843
|
-
* wrapper for a request
|
|
9842
|
+
* RequestState extends the concept of {@link PromiseState} to provide a reactive
|
|
9843
|
+
* wrapper for a request {@link Future} which allows you write declarative code
|
|
9844
9844
|
* around a Future's control flow.
|
|
9845
9845
|
*
|
|
9846
9846
|
* It is useful in both Template and JavaScript contexts, allowing you
|
|
9847
9847
|
* to quickly derive behaviors and data from pending, error and success
|
|
9848
9848
|
* states.
|
|
9849
9849
|
*
|
|
9850
|
-
* The key difference between a Promise and a Future is that Futures provide
|
|
9851
|
-
* access to a stream of their content, the
|
|
9852
|
-
* as well as the ability to attempt to abort the request.
|
|
9850
|
+
* The key difference between a {@link Promise} and a Future is that Futures provide
|
|
9851
|
+
* access to a {@link ReadableStream | stream} of their content, the {@link RequestKey} of the request (if any)
|
|
9852
|
+
* as well as the ability to attempt to {@link Future.abort | abort} the request.
|
|
9853
9853
|
*
|
|
9854
9854
|
* ```ts
|
|
9855
9855
|
* interface Future<T> extends Promise<T>> {
|
|
@@ -9861,7 +9861,7 @@ defineNonEnumerableSignal(RequestLoadingState.prototype, '_lastPacketTime', 0);
|
|
|
9861
9861
|
*
|
|
9862
9862
|
* These additional APIs allow us to craft even richer state experiences.
|
|
9863
9863
|
*
|
|
9864
|
-
* To get the state of a request, use
|
|
9864
|
+
* To get the state of a request, use {@link getRequestState}.
|
|
9865
9865
|
*
|
|
9866
9866
|
* See also:
|
|
9867
9867
|
* - {@link PendingRequest}
|
package/dist/store/-private.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { C as CacheHandler, D as DISPOSE, R as RecordArrayManager, x as Signals, S as Store, g as StoreMap, _ as _clearCaches, n as _deprecatingNormalize, b as coerceId, c as constructResource, B as consumeInternalSignal, h as createLegacyManyArray, m as createRequestSubscription, v as defineGate, w as defineNonEnumerableSignal, u as defineSignal, e as ensureStringId, t as entangleSignal, f as fastPush, q as gate, E as getOrCreateInternalSignal, k as getPromiseState, o as getRequestState, a as isRequestKey, i as isResourceKey, l as log, j as logGroup, p as memoized, A as notifyInternalSignal, y as peekInternalSignal, r as recordIdentifierFor, d as setRecordIdentifier, s as storeFor, z as withSignalStore } from "../request-state-
|
|
1
|
+
export { C as CacheHandler, D as DISPOSE, R as RecordArrayManager, x as Signals, S as Store, g as StoreMap, _ as _clearCaches, n as _deprecatingNormalize, b as coerceId, c as constructResource, B as consumeInternalSignal, h as createLegacyManyArray, m as createRequestSubscription, v as defineGate, w as defineNonEnumerableSignal, u as defineSignal, e as ensureStringId, t as entangleSignal, f as fastPush, q as gate, E as getOrCreateInternalSignal, k as getPromiseState, o as getRequestState, a as isRequestKey, i as isResourceKey, l as log, j as logGroup, p as memoized, A as notifyInternalSignal, y as peekInternalSignal, r as recordIdentifierFor, d as setRecordIdentifier, s as storeFor, z as withSignalStore } from "../request-state-0_fVMu9R.js";
|
|
2
2
|
export { A as ARRAY_SIGNAL, O as OBJECT_SIGNAL, c as createMemo, w as waitFor } from "../configure-B48bFHOl.js";
|
package/dist/types/-private.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { macroCondition, getGlobalConfig } from '@embroider/macros';
|
|
2
2
|
const name = "@warp-drive/core";
|
|
3
|
-
const version = "5.7.0-alpha.
|
|
3
|
+
const version = "5.7.0-alpha.18";
|
|
4
4
|
|
|
5
5
|
// in testing mode, we utilize globals to ensure only one copy exists of
|
|
6
6
|
// these maps, due to bugs in ember-auto-import
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warp-drive/core",
|
|
3
|
-
"version": "5.7.0-alpha.
|
|
3
|
+
"version": "5.7.0-alpha.18",
|
|
4
4
|
"description": "Core package for WarpDrive | All the Universal Basics",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@embroider/macros": "^1.16.12",
|
|
40
|
-
"@warp-drive/build-config": "5.7.0-alpha.
|
|
40
|
+
"@warp-drive/build-config": "5.7.0-alpha.18"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@babel/core": "^7.26.10",
|
|
44
44
|
"@babel/plugin-transform-typescript": "^7.27.0",
|
|
45
45
|
"@babel/preset-typescript": "^7.27.0",
|
|
46
|
-
"@warp-drive/internal-config": "5.7.0-alpha.
|
|
46
|
+
"@warp-drive/internal-config": "5.7.0-alpha.18",
|
|
47
47
|
"decorator-transforms": "^2.3.0",
|
|
48
48
|
"ember-source": "~6.3.0",
|
|
49
49
|
"expect-type": "^1.2.1",
|