on method

JSFunction on(
  1. String eventType,
  2. JSFunction callback, [
  3. JSObject? cancelCallbackOrContext,
  4. JSObject? context,
])

Listens for data changes at a particular location.

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 to off().

Implementation

external JSFunction on(
  String eventType,
  // (a: DataSnapshot, b?: string | null) => any
  JSFunction callback, [
  // (a: Error) => any)
  JSObject? cancelCallbackOrContext,
  JSObject? context,
]);