MCPcopy Index your code
hub / github.com/angular/angular / onSerialize

Method onSerialize

packages/core/src/transfer_state.ts:124–126  ·  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

122 * Register a callback to provide the value for a key when `toJson` is called.
123 */
124 onSerialize<T>(key: StateKey<T>, callback: () => T): void {
125 this.onSerializeCallbacks[key] = callback;
126 }
127
128 /**
129 * Serialize the current state of the store to JSON.

Callers 2

constructorMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected