You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allows to send an event while awaiting for a specific state or set of states to resume.
333
333
334
334
```swift
@@ -337,9 +337,10 @@ await viewStateMachine.send(
337
337
resumeWhen: .closed
338
338
)`
339
339
```
340
+
</details>
340
341
341
-
### Side effect cancellation
342
-
342
+
<details>
343
+
<summary>Side effect cancellation</summary>
343
344
Make `close(speed:)` side effect execution be cancelled when the state machine produces any new states. It is also possible to cancel on a specific state.
344
345
345
346
```swift
@@ -349,26 +350,28 @@ Runtime.map(
349
350
strategy: .cancelWhenAnyState
350
351
)
351
352
```
353
+
</details>
352
354
353
-
### States set
354
-
355
+
<details>
356
+
<summary>States set</summary>
355
357
Allows to factorize the same transition for a set of states.
356
358
357
359
```swift
358
360
When(states: OneOf {
359
-
State.closing(persons:),
360
-
State.closed
361
+
State.closing(persons:),
362
+
State.closed
361
363
}) { _in
362
-
Execute.noOutput
364
+
Execute.noOutput
363
365
} transitions: {
364
-
On(event: Event.closeButtonWasPressed) { _in
365
-
Transition(to: State.opening)
366
-
}
367
-
}`
366
+
On(event: Event.closeButtonWasPressed) { _in
367
+
Transition(to: State.opening)
368
+
}
369
+
}`
368
370
```
371
+
</details>
369
372
370
-
### SwiftUI bindings
371
-
373
+
<details>
374
+
<summary>SwiftUI bindings</summary>
372
375
Allows to create a SwiftUI binding on the current state, sending an Event when the binding changes.
373
376
374
377
```swift
@@ -380,9 +383,10 @@ Allows to create a SwiftUI binding on a property of the current state, sending a
0 commit comments