Change class

The Cloud Functions interface for events that change state, such as Realtime Database or Cloud Firestore onWrite and onUpdate events.

For more information about the format used to construct Change objects, see below.

Signature:

export declare class Change<T> 

Constructors

ConstructorModifiersDescription
(constructor)(before, after)Constructs a new instance of the Change class

Properties

PropertyModifiersTypeDescription
afterT
beforeT

Methods

MethodModifiersDescription
fromJSON(json, customizer)staticFactory method for creating a Change from JSON and an optional customizer function to be applied to both the before and the after fields.
fromObjects(before, after)staticFactory method for creating a Change from a before object and an after object.

Change.(constructor)

Constructs a new instance of the Change class

Signature:

constructor(before: T, after: T);

Parameters

ParameterTypeDescription
beforeT
afterT

Change.after

Signature:

after: T;

Change.before

Signature:

before: T;

Change.fromJSON()

Factory method for creating a Change from JSON and an optional customizer function to be applied to both the before and the after fields.

Signature:

static fromJSON<T>(json: ChangeJson, customizer?: (x: any) => T): Change<T>;

Parameters

ParameterTypeDescription
jsonChangeJson
customizer(x: any) => T

Returns:

Change<T>

Change.fromObjects()

Factory method for creating a Change from a before object and an after object.

Signature:

static fromObjects<T>(before: T, after: T): Change<T>;

Parameters

ParameterTypeDescription
beforeT
afterT

Returns:

Change<T>