Client Library Status
Retrieving the client state
Last updated
Was this helpful?
Was this helpful?
getState(): ClientStateconst st = zkClient.getState();
if (st == ClientState.StateUpdating || st == ClientState.StateUpdatingContinuous) {
console.log('Please wait while local state becomes up-to-dated');
}
// output: Please wait while local state becomes up-to-datedgetProgress(): number | undefined;const st = zkClient.getState();
const pr = zkClient.getProgress();
if (st == ClientState.StateUpdating) {
const progressStr = (pr !== undefined ? `(${(pr * 100.0).toFixed(1)}%)` : '');
console.log(`Please wait while local state becomes up-to-dated ${progressStr}`);
}
// output: Please wait while local state becomes up-to-dated (42.0%)