Skip to content

Commit

Permalink
[@xstate/lit] Fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarmarina committed Mar 8, 2024
1 parent 40ebdaa commit eb66d11
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/xstate-lit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ npm i xstate @xstate/lit

2. Import the `UseMachine` Lit controller:

**`new UseMachine(this, {machine, options?, subscriptionProperty?)`**
**`new UseMachine(this, {machine, options?, callback?})`**

```js
import { html, LitElement } from 'lit';
Expand Down Expand Up @@ -76,7 +76,7 @@ constructor() {

## API

### `new UseMachine(host, {machine, options?, subscriptionProperty?})`
### `new UseMachine(host, {machine, options?, callback?})`

A class that creates an actor from the given machine and starts a service that runs for the lifetime of the component.

Expand All @@ -91,7 +91,7 @@ A class that creates an actor from the given machine and starts a service that r

`actor` - Returns the actor (state machine) instance.
`snapshot` - Returns the current state snapshot.
`send` - Sends an event to the state machine.
`send` - Send an event to the state machine.
`unsubscribe` - Unsubscribes from state updates.

## Matching States
Expand All @@ -118,9 +118,9 @@ const persistedState = JSON.parse(
);
// highlight-end

connectedCallback() {
super.connectedCallback && super.connectedCallback();
this.fetchController = this.fetchController ?? new UseMachine(this, {
constructor() {
super();
this.fetchController = new UseMachine(this, {
machine: someMachine,
options: {
snapshot: this.persistedState
Expand Down

0 comments on commit eb66d11

Please sign in to comment.