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
Copy file name to clipboardExpand all lines: README.md
+51-5
Original file line number
Diff line number
Diff line change
@@ -96,9 +96,9 @@ In our example, one feedback takes care of increasing the volume and the other i
96
96
97
97
## Scheduling
98
98
99
-
Threading is very important to make a nice responsive application. A Scheduler is the Combine way of handling threading by switching portions of reactive streams on dispatch queues, or operation queues or RunLoops.
99
+
Threading is very important to make a nice responsive application. A Scheduler is the Combine way of handling threading by switching portions of reactive streams on dispatch queues, operation queues or RunLoops.
100
100
101
-
The declarative syntax of Feedbacks allows to alter the behavior of side effects by simply applying modifiers (like you would do with SwiftUI to change the frame for instance). Modifying the scheduling of a side effect isas simple as calling the `.execute(on:)` modifier.
101
+
The declarative syntax of Feedbacks allows to alter the behavior of a System by simply applying modifiers (like you would do with SwiftUI to change the frame for instance). Modifying the scheduling of a side effect isas simple as calling the `.execute(on:)` modifier.
102
102
103
103
```swift
104
104
Feedbacks {
@@ -128,6 +128,52 @@ Feedbacks {
128
128
129
129
Both side effects will be executed on the background queue.
}.execute(on: DispatchQueue(label: "A background queue"))
175
+
```
176
+
131
177
## Lifecycle
132
178
133
179
There are typical cases where a side effect consist of an asynchronous operation (like a network call). What happens if the very same side effect is called repeatedly, not waiting for the previous ones to end? Are the operations stacked? Are they cancelled when a new one is performed?
@@ -196,9 +242,9 @@ Here is a list of the supported modifiers:
196
242
| Modifier | Action | Can be applied to |
197
243
|--------------|--------------|--------------|
198
244
| `.disable(disabled:)`| The target won't be executed as long as the `disabled` condition istrue|<ul align="left"><li>Transition</li><li>Transitions</li><li>Feedback</li></ul>|
199
-
| `.execute(on:)`| The target will be executed on the scheduler |<ul align="left"><li>Feedbacks</li><li>Feedback</li></ul>|
200
-
| `.onStateReceived(perform:)`| Execute the `perform` closure each time a new state is given as an input |<ul align="left"><li>Feedbacks</li><li>Feedback</li></ul>|
201
-
| `.onEventEmitted(perform:)`| Execute the `perform` closure each time a new event is emitted |<ul align="left"><li>Feedbacks</li><li>Feedback</li></ul>|
245
+
| `.execute(on:)`| The target will be executed on the scheduler |<ul align="left"><li>Transitions</li><li>Feedback</li><li>Feedbacks</li><li>System</li></ul>|
246
+
| `.onStateReceived(perform:)`| Execute the `perform` closure each time a new state is given as an input |<ul align="left"><li>Feedback</li><li>Feedbacks</li></ul>|
247
+
| `.onEventEmitted(perform:)`| Execute the `perform` closure each time a new event is emitted |<ul align="left"><li>Feedback</li><li>Feedbacks</li></ul>|
202
248
| `.attach(to:)`| Refer to the "How to make systems communicate" section |<ul align="left"><li>System</li><li>UISystem</li></ul>|
203
249
| `.uiSystem(viewStateFactory:)`| Refer to the "Using Feedbacks with SwiftUI and UIKit" section |<ul align="left"><li>System</li></ul>|
0 commit comments