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
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(before, after) | Constructs a new instance of the Change class |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| after | T | ||
| before | T |
Methods
| Method | Modifiers | Description |
|---|---|---|
| fromJSON(json, customizer) | static |
Factory 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) | static |
Factory 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
| Parameter | Type | Description |
|---|---|---|
| before | T | |
| after | T |
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
| Parameter | Type | Description |
|---|---|---|
| json | ChangeJson | |
| 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
| Parameter | Type | Description |
|---|---|---|
| before | T | |
| after | T |
Returns:
Change<T>