Skip to content

Commit

Permalink
remove unused autoConnect option from the codebase (#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
Edoardo Gallo authored Dec 21, 2021
1 parent c564fa6 commit 66e6e30
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
1 change: 0 additions & 1 deletion packages/js/examples/ts-vanilla/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ window._makeClient = async ({ token, emitter }) => {
const client = await Video.createClient({
host: 'relay.swire.io',
token,
autoConnect: false,
emitter,
})

Expand Down
22 changes: 1 addition & 21 deletions packages/js/src/createClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,10 @@ import { JWTSession } from './JWTSession'
* Create a client
*
* @example
* With autoConnect true the client is ready to be used.
* ```js
* try {
* const client = await Video.createClient({
* token: '<YourToken>',
* })
*
* // Your client is already connected..
* } catch (error) {
* console.error('Auth Error', error)
* }
* ```
*
* @example
* With autoConnect false you can attach additional handlers.
* ```js
* try {
* const client = await Video.createClient({
* const client = Video.createClient({
* token: '<YourJWT>',
* autoConnect: false,
* })
*
* client.on('socket.closed', () => {
* // The WebSocket connection is closed
* })
*
* await client.connect()
Expand Down
2 changes: 1 addition & 1 deletion packages/realtime-api/src/createClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Client, RealtimeClient } from './Client'
import { Session } from './Session'

/** @internal */
export interface CreateClientOptions extends Omit<UserOptions, 'autoConnect'> {}
export interface CreateClientOptions extends UserOptions {}
export type { RealtimeClient, ClientEvents }

/**
Expand Down

0 comments on commit 66e6e30

Please sign in to comment.