ThenableReference | JavaScript SDK | Firebase JavaScript API reference
Index
Properties
key
key: string | null
parent
ref
root
Methods
child
endAt
endBefore
equalTo
get
- get ( ) : Promise < DataSnapshot >
-
Returns Promise<DataSnapshot>
A promise which resolves to the resulting DataSnapshot if a value is available, or rejects if the client is unable to return a value (e.g., if the server is unreachable and there is nothing cached).
isEqual
limitToFirst
limitToLast
off
- off ( eventType ? : EventType , callback ? : ( a : DataSnapshot , b ? : string | null ) => any , context ? : Object | null ) : void
-
Parameters
-
Optional eventType: EventType
-
Optional callback: (a: DataSnapshot, b?: string | null) => any
-
- (a: DataSnapshot, b?: string | null): any
-
Parameters
-
a: DataSnapshot
-
Optional b: string | null
Returns any
-
-
-
Optional context: Object | null
Returns void
-
on
- on ( eventType : EventType , callback : ( a : DataSnapshot , b ? : string | null ) => any , cancelCallbackOrContext ? : ( ( a : Error ) => any ) | Object | null , context ? : Object | null ) : ( a : DataSnapshot | null , b ? : string | null ) => any
-
Parameters
-
eventType: EventType
-
callback: (a: DataSnapshot, b?: string | null) => any
-
- (a: DataSnapshot, b?: string | null): any
-
Parameters
-
a: DataSnapshot
-
Optional b: string | null
Returns any
-
-
-
Optional cancelCallbackOrContext: ((a: Error) => any) | Object | null
-
Optional context: Object | null
Returns (a: DataSnapshot | null, b?: string | null) => any
The provided callback function is returned unmodified. This is just for convenience if you want to pass an inline function to
on()but store the callback function for later passing tooff().-
- (a: DataSnapshot | null, b?: string | null): any
-
Parameters
-
a: DataSnapshot | null
-
Optional b: string | null
Returns any
-
-
onDisconnect
- on
Disconnect ( ) : OnDisconnect -
Returns OnDisconnect
once
- once ( eventType : EventType , successCallback ? : ( a : DataSnapshot , b ? : string | null ) => any , failureCallbackOrContext ? : ( ( a : Error ) => void ) | Object | null , context ? : Object | null ) : Promise < DataSnapshot >
-
Parameters
-
eventType: EventType
-
Optional successCallback: (a: DataSnapshot, b?: string | null) => any
-
- (a: DataSnapshot, b?: string | null): any
-
Parameters
-
a: DataSnapshot
-
Optional b: string | null
Returns any
-
-
-
Optional failureCallbackOrContext: ((a: Error) => void) | Object | null
-
Optional context: Object | null
Returns Promise<DataSnapshot>
-
orderByChild
orderByKey
orderByPriority
orderByValue
push
- push ( value ? : any , onComplete ? : ( a : Error | null ) => any ) : ThenableReference
-
Parameters
-
Optional value: any
-
Optional onComplete: (a: Error | null) => any
Returns ThenableReference
Combined
PromiseandReference; resolves when write is complete, but can be used immediately as theReferenceto the child location. -
remove
set
setPriority
setWithPriority
startAfter
startAt
toJSON
- toJSON ( ) : Object
-
Returns Object
A JSON-serializable representation of this object.
toString
- to
String ( ) : string -
Returns string
The absolute URL for this location.
transaction
- transaction ( transactionUpdate : ( a : any ) => any , onComplete ? : ( a : Error | null , b : boolean , c : DataSnapshot | null ) => void , applyLocally ? : boolean ) : Promise < TransactionResult >
-
Parameters
-
transactionUpdate: (a: any) => any
-
- (a: any): any
-
Parameters
-
a: any
Returns any
-
-
-
Optional onComplete: (a: Error | null, b: boolean, c: DataSnapshot | null) => void
-
- (a: Error | null, b: boolean, c: DataSnapshot | null): void
-
Parameters
-
a: Error | null
-
b: boolean
-
c: DataSnapshot | null
Returns void
-
-
-
Optional applyLocally: boolean
Returns Promise<TransactionResult>
Returns a Promise that can optionally be used instead of the onComplete callback to handle success and failure.
-