You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Todo: the timeout option is not currently used in the LongPollListner. Add support for it.
124
+
// timeout?: number;
125
+
/**
126
+
* Any headers that need to be included in requests to your long polling endpoint. Defaults to an empty object.
127
+
*/
77
128
headers?: HeadersInit;
129
+
/**
130
+
* The fetch method to use when making requests. Defaults to the global fetch method.
131
+
*/
78
132
fetch?: typeofglobalThis.fetch;
79
133
}
80
134
135
+
/**
136
+
* A CommitsListener that polls an endpoint for remote updates to a document. Intended to be used
137
+
* with an remote long polling endpoint that calls a Collab Authority's {@link https://pitter-patter.dev/docs/collab/reference/collab-server/classes/CollabAuthority#listenforcommit | listenForCommit}
138
+
* function to efficiently listen for updates.
139
+
*/
81
140
exportclassLongPollListener{
82
141
privateheaders: HeadersInit;
83
142
privatefetch: typeofglobalThis.fetch;
84
143
144
+
/**
145
+
* @param url - the url that polling requests will be sent to
146
+
*/
85
147
constructor(
86
148
privateurl: URL,
87
149
options: LongPollListenerOptions={},
@@ -90,6 +152,9 @@ export class LongPollListener {
0 commit comments