Skip to content

Commit

Permalink
fix: on client instantiation, attempt to connect
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-berger committed Sep 24, 2024
1 parent b22f5cb commit 7982e94
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,14 @@ export class WmClient {
private _onErrorCallbacks: ErrorCallback[] = [];

/**
* Instantiates client.
* Instantiates client and attempts to connect to IPC server.
*
* Connection to the IPC server is established when sending the first
* message or by explicitly calling {@link connect}.
* The client will automatically attempt to reconnect on disconnections,
* configurable via {@link WmClientOptions.reconnectInterval}.
*/
constructor(private _options?: WmClientOptions) {}
constructor(private _options?: WmClientOptions) {
this.connect().catch(() => {});
}

/**
* Gets all monitors. {@link Monitor}
Expand Down

0 comments on commit 7982e94

Please sign in to comment.