# State machines

LiveStore can be used to implement state machines or together with existing state machine libraries (e.g. [XState](https://stately.ai/docs/xstate)).

The basic idea is to listen query results and emit events when the query results change. The state machine side effects can then further commit new mutations to LiveStore.

## Example

```ts
// TODO (contribution welcome)
```