Skip to content

Commit

Permalink
feat: Expose appDict (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach authored Aug 11, 2024
1 parent 1263fda commit 1ec4be5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mixins/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export async function connect (timeout = APP_CONNECT_TIMEOUT_MS) {
this.log.debug(`Timed out waiting for applications to be reported`);
}
}
return _.cloneDeep(getAppDict(this));
return this.appDict;
} catch (err) {
this.log.error(`Error setting connection key: ${err.message}`);
await this.disconnect();
Expand Down
7 changes: 7 additions & 0 deletions lib/remote-debugger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,13 @@ export class RemoteDebugger extends EventEmitter {
return !!this._rpcClient?.isConnected;
}

// Only use this getter to read the appDict value.
// Any changes to it don't mutate the original property
// because the getter always returns the copy of it
get appDict(): AppDict {
return _.cloneDeep(this._appDict);
}

set allowNavigationWithoutReload (allow: boolean) {
this._allowNavigationWithoutReload = allow;
}
Expand Down

0 comments on commit 1ec4be5

Please sign in to comment.