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

Method onSerialize

packages/core/src/transfer_state.ts:132–134  ·  view source on GitHub ↗

* Register a callback to provide the value for a key when `toJson` is called.

(key: StateKey<T>, callback: () => T)

Source from the content-addressed store, hash-verified

130 * Register a callback to provide the value for a key when `toJson` is called.
131 */
132 onSerialize<T>(key: StateKey<T>, callback: () => T): void {
133 this.onSerializeCallbacks[key] = callback;
134 }
135
136 /**
137 * Serialize the current state of the store to JSON.

Callers 2

constructorMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected