onDocumentWrittenWithAuthContext method

JSFunction onDocumentWrittenWithAuthContext(
  1. JSAny documentOrOpts,
  2. JSFunction handler
)

Event handler that triggers when a document is created, updated, or deleted in Firestore. This trigger also provides the authentication context of the principal who triggered the event.

@param document - The Firestore document path to trigger on. @param handler - Event handler which is run every time a Firestore create, update, or delete occurs.

Implementation

external JSFunction onDocumentWrittenWithAuthContext(
  JSAny documentOrOpts,
  // (FirestoreAuthEvent<DocumentSnapshot> event) => FutureOr<void>
  JSFunction handler,
);