Change class

The Cloud Functions interface for events that change state, such as Realtime Database or Cloud FirestoreonWrite andonUpdate events.

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

Signature:

exportdeclareclassChange<T>

Constructors

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

Properties

PropertyModifiersTypeDescription
afterT
beforeT

Methods

MethodModifiersDescription
fromJSON(json, customizer)staticFactory method for creating aChange from JSON and an optional customizer function to be applied to both thebefore and theafter fields.
fromObjects(before, after)staticFactory method for creating aChange from abefore object and anafter object.

Change.(constructor)

Constructs a new instance of theChange 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 aChange from JSON and an optional customizer function to be applied to both thebefore and theafter fields.

Signature:

staticfromJSON<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 aChange from abefore object and anafter object.

Signature:

staticfromObjects<T>(before:T,after:T):Change<T>;

Parameters

ParameterTypeDescription
beforeT
afterT

Returns:

Change<T>

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2023-11-21 UTC.