mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
refactor(http): add context property to httpResource (#60188)
This was an oversight, `context` can be supported out of the box. PR Close #60188
This commit is contained in:
committed by
Miles Malerba
parent
8b8e3fdca4
commit
bb14fe86e3
@@ -1741,6 +1741,7 @@ export interface HttpResourceRef<T> extends WritableResource<T>, ResourceRef<T>
|
||||
// @public
|
||||
export interface HttpResourceRequest {
|
||||
body?: unknown;
|
||||
context?: HttpContext;
|
||||
headers?: HttpHeaders | Record<string, string | ReadonlyArray<string>>;
|
||||
method?: string;
|
||||
params?: HttpParams | Record<string, string | number | boolean | ReadonlyArray<string | number | boolean>>;
|
||||
|
||||
@@ -10,6 +10,7 @@ import type {Injector, ResourceRef, Signal, ValueEqualityFn, WritableResource} f
|
||||
import type {HttpHeaders} from './headers';
|
||||
import type {HttpParams} from './params';
|
||||
import type {HttpProgressEvent} from './response';
|
||||
import {HttpContext} from './context';
|
||||
|
||||
/**
|
||||
* The structure of an `httpResource` request which will be sent to the backend.
|
||||
@@ -50,6 +51,11 @@ export interface HttpResourceRequest {
|
||||
*/
|
||||
headers?: HttpHeaders | Record<string, string | ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Context of the request stored in a dictionary of key-value pairs.
|
||||
*/
|
||||
context?: HttpContext;
|
||||
|
||||
/**
|
||||
* If `true`, progress events will be enabled for the request and delivered through the
|
||||
* `HttpResource.progress` signal.
|
||||
|
||||
Reference in New Issue
Block a user