MCPcopy Create free account
hub / github.com/angular/angular / WritableResource

Interface WritableResource

packages/core/src/resource/api.ts:134–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132 * @publicApi 22.0
133 */
134export interface WritableResource<T> extends Resource<T> {
135 readonly value: WritableSignal<T>;
136 hasValue(
137 this: T extends undefined ? this : never,
138 ): this is WritableResource<Exclude<T, undefined>>;
139
140 hasValue(): boolean;
141
142 /**
143 * Convenience wrapper for `value.set`.
144 */
145 set(value: T): void;
146
147 /**
148 * Convenience wrapper for `value.update`.
149 */
150 update(updater: (value: T) => T): void;
151 asReadonly(): Resource<T>;
152
153 /**
154 * Instructs the resource to re-load any asynchronous dependency it may have.
155 *
156 * Note that the resource will not enter its reloading state until the actual backend request is
157 * made.
158 *
159 * @returns true if a reload was initiated, false if a reload was unnecessary or unsupported
160 */
161 reload(): boolean;
162}
163
164/**
165 * A `WritableResource` created through the `resource` function.

Callers 32

applyWithProgramMethod · 0.65
getOrCreateRendererMethod · 0.65
addServerStylesFunction · 0.65
addUsageMethod · 0.65
_findPluginForMethod · 0.65
updateClientMethod · 0.65
initializeMethod · 0.65
assignVersionMethod · 0.65
reloadMethod · 0.65
wrapStateFunction · 0.65

Calls

no outgoing calls

Tested by

no test coverage detected