@mmstack/resource 20.5.2 → 20.6.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.
- package/README.md +4 -4
- package/fesm2022/mmstack-resource.mjs +221 -129
- package/fesm2022/mmstack-resource.mjs.map +1 -1
- package/index.d.ts +5 -2
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpResponse, HttpInterceptorFn, HttpContext, HttpResourceRef, HttpHeaders, HttpResourceRequest, HttpResourceOptions } from '@angular/common/http';
|
|
1
|
+
import { HttpResponse, HttpInterceptorFn, HttpRequest, HttpContext, HttpResourceRef, HttpHeaders, HttpResourceRequest, HttpResourceOptions } from '@angular/common/http';
|
|
2
2
|
import { Signal, Injector, Provider, WritableSignal, ValueEqualityFn } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
type StoredEntry<T> = Omit<CacheEntry<T>, 'timeout'>;
|
|
@@ -437,6 +437,9 @@ declare function noDedupe(ctx?: HttpContext): HttpContext;
|
|
|
437
437
|
*
|
|
438
438
|
* @param allowed - An array of HTTP methods for which deduplication should be enabled.
|
|
439
439
|
* Defaults to `['GET', 'DELETE', 'HEAD', 'OPTIONS']`.
|
|
440
|
+
* @param keyFn - Optional function to compute the dedupe key from a request.
|
|
441
|
+
* Defaults to `hashRequest`, which includes method, URL,
|
|
442
|
+
* response type, params, and body.
|
|
440
443
|
*
|
|
441
444
|
* @returns An `HttpInterceptorFn` that implements the request deduplication logic.
|
|
442
445
|
*
|
|
@@ -460,7 +463,7 @@ declare function noDedupe(ctx?: HttpContext): HttpContext;
|
|
|
460
463
|
* ],
|
|
461
464
|
* };
|
|
462
465
|
*/
|
|
463
|
-
declare function createDedupeRequestsInterceptor(allowed?: string[]): HttpInterceptorFn;
|
|
466
|
+
declare function createDedupeRequestsInterceptor(allowed?: string[], keyFn?: (req: HttpRequest<unknown>) => string): HttpInterceptorFn;
|
|
464
467
|
|
|
465
468
|
type RetryOptions = number | {
|
|
466
469
|
max?: number;
|