From ce95ba870faa78c90659b106480a4232356321c5 Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Thu, 9 May 2024 20:00:34 +0200 Subject: [PATCH] add docs for url parameters --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ca21bab..24ff5c7 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ import { WebsocketProvider } from 'y-websocket' wsOpts = { // Set this to `false` if you want to connect manually using wsProvider.connect() connect: true, - // Specify a query-string that will be url-encoded and attached to the `serverUrl` + // Specify a query-string / url parameters that will be url-encoded and attached to the `serverUrl` // I.e. params = { auth: "bearer" } will be transformed to "?auth=bearer" params: {}, // Object // You may polyill the Websocket object (https://developer.mozilla.org/en-US/docs/Web/API/WebSocket). @@ -106,6 +106,10 @@ wsOpts = {
True if this instance is currently communicating to other browser-windows via BroadcastChannel.
wsProvider.synced: boolean
True if this instance is currently connected and synced with the server.
+ wsProvider.params : boolean +
The specified url parameters. This can be safely updated, the new values + will be used when a new connction is established. If this contains an + auth token, it should be updated regularly.
wsProvider.disconnect()
Disconnect from the server and don't try to reconnect.
wsProvider.connect()