Skip to content

Commit d309eaf

Browse files
committed
remote/connection.ts: update docs to clarify the difference between onOpen and onConnected
1 parent 590d5af commit d309eaf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/firestore/src/remote/connection.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,11 @@ export interface Connection {
109109
* A bidirectional stream that can be used to send an receive messages.
110110
*
111111
* A stream can be closed locally with close() or can be closed remotely or
112-
* through network errors. onClose is guaranteed to be called. onOpen will only
113-
* be called if the stream successfully established a connection.
112+
* through network errors. onClose is guaranteed to be called. onOpen will be
113+
* called once the stream is ready to send messages (which may or may not be
114+
* before an actual connection to the backend has been established). The
115+
* onConnected event is called when an actual, physical connection with the
116+
* backend has been established, and may occur before or after the onOpen event.
114117
*/
115118
export interface Stream<I, O> {
116119
onConnected(callback: () => void): void;

0 commit comments

Comments
 (0)