Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Tymek authored Jun 24, 2024
1 parent b431744 commit 68e2847
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ If `bootstrapOverride` is `false` any local cached data will not be overridden u

## Internal state

You can get the state with `client.getState()` method. The `getState().status` is an changing according to the followind diagram:
When possible it's recommended to use event-based communication with the client, but it's not always possible. One example is a reuse of existing and initialized client.
To do this, you can get the state with `client.getState()` method. The `getState().status` is changing according to the followind diagram:

```mermaid
graph LR;
Expand All @@ -308,4 +309,4 @@ You can get the state with `client.getState()` method. The `getState().status` i
stopped-->starting;
```

There is also error state, which is not shown in the diagram (with the value of `{ status: "error", error: <Error> }`). The client will try to recover from the error, go back to `healthy` staus, and emit a `recovered` event when it does.
There exists also an error state, which is not shown in the diagram (with the value of `{ status: "error", error: <Error> }`). The client will try to recover from the error, go back to `healthy` staus, and emit a `recovered` event when it does so.

0 comments on commit 68e2847

Please sign in to comment.