@blockquote-web-components/blockquote-controller-xstate 2.3.12 → 2.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -17
- package/package.json +2 -2
- package/src/BlockquoteControllerXstate.js +8 -0
package/README.md
CHANGED
|
@@ -189,26 +189,26 @@ export class XstateCounter extends LitElement {
|
|
|
189
189
|
|
|
190
190
|
##### Fields
|
|
191
191
|
|
|
192
|
-
| Name | Privacy | Type | Default | Description
|
|
193
|
-
| ----------------- | ------- | ---- | ---------- |
|
|
194
|
-
| `actor` | | | |
|
|
195
|
-
| `snapshot` | | | |
|
|
196
|
-
| `onNext` | | | |
|
|
197
|
-
| `machine` | | | `machine` |
|
|
198
|
-
| `options` | | | `options` |
|
|
199
|
-
| `callback` | | | `callback` |
|
|
200
|
-
| `currentSnapshot` | | | |
|
|
192
|
+
| Name | Privacy | Type | Default | Description | Inherited From |
|
|
193
|
+
| ----------------- | ------- | ---- | ---------- | ---------------------------------------- | -------------- |
|
|
194
|
+
| `actor` | | | | The underlying ActorRef from XState | |
|
|
195
|
+
| `snapshot` | | | | The latest snapshot of the actor's state | |
|
|
196
|
+
| `onNext` | | | | Internal subscriber for state changes | |
|
|
197
|
+
| `machine` | | | `machine` | | |
|
|
198
|
+
| `options` | | | `options` | | |
|
|
199
|
+
| `callback` | | | `callback` | | |
|
|
200
|
+
| `currentSnapshot` | | | | | |
|
|
201
201
|
|
|
202
202
|
##### Methods
|
|
203
203
|
|
|
204
|
-
| Name | Privacy | Description
|
|
205
|
-
| ------------------ | ------- |
|
|
206
|
-
| `send` | |
|
|
207
|
-
| `unsubscribe` | |
|
|
208
|
-
| `startService` | |
|
|
209
|
-
| `stopService` | |
|
|
210
|
-
| `hostConnected` | |
|
|
211
|
-
| `hostDisconnected` | |
|
|
204
|
+
| Name | Privacy | Description | Parameters | Return | Inherited From |
|
|
205
|
+
| ------------------ | ------- | ---------------------------------- | ------------------------------------ | ------ | -------------- |
|
|
206
|
+
| `send` | | Send an event to the actor service | `ev: EventFrom<typeof this.machine>` | | |
|
|
207
|
+
| `unsubscribe` | | | | | |
|
|
208
|
+
| `startService` | | | | | |
|
|
209
|
+
| `stopService` | | | | | |
|
|
210
|
+
| `hostConnected` | | | | | |
|
|
211
|
+
| `hostDisconnected` | | | | | |
|
|
212
212
|
|
|
213
213
|
<hr/>
|
|
214
214
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockquote-web-components/blockquote-controller-xstate",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.13",
|
|
4
4
|
"description": "This controller allows you to subscribe to an XState actor, updating a specified reactive property whenever the state machine transitions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lit",
|
|
@@ -124,5 +124,5 @@
|
|
|
124
124
|
"access": "public"
|
|
125
125
|
},
|
|
126
126
|
"customElements": "custom-elements.json",
|
|
127
|
-
"gitHead": "
|
|
127
|
+
"gitHead": "58ac0510984ad30198e9eac25d2a304fda7f22c7"
|
|
128
128
|
}
|
|
@@ -202,15 +202,22 @@ class UseMachine {
|
|
|
202
202
|
(this.host = host).addController(this);
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
/**
|
|
206
|
+
* The underlying ActorRef from XState
|
|
207
|
+
*/
|
|
205
208
|
get actor() {
|
|
206
209
|
return this.actorRef;
|
|
207
210
|
}
|
|
208
211
|
|
|
212
|
+
/**
|
|
213
|
+
* The latest snapshot of the actor's state
|
|
214
|
+
*/
|
|
209
215
|
get snapshot() {
|
|
210
216
|
return this.actorRef?.getSnapshot?.();
|
|
211
217
|
}
|
|
212
218
|
|
|
213
219
|
/**
|
|
220
|
+
* Send an event to the actor service
|
|
214
221
|
* @param {import('xstate').EventFrom<typeof this.machine>} ev
|
|
215
222
|
*/
|
|
216
223
|
send(ev) {
|
|
@@ -222,6 +229,7 @@ class UseMachine {
|
|
|
222
229
|
}
|
|
223
230
|
|
|
224
231
|
/**
|
|
232
|
+
* Internal subscriber for state changes
|
|
225
233
|
* @param {import('xstate').SnapshotFrom<typeof this.machine>} snapshot
|
|
226
234
|
*/
|
|
227
235
|
onNext = (snapshot) => {
|