Commit 876e575
authored
[BREAKING CHANGE]: update WorkflowAction API to expose access to Workflow instance values (#349)
this BREAKING change updates the WorkflowAction API to pass through a
new parameter in the `apply()` method that allows reading values off the
corresponding node's current Workflow instance. the new method signature
is:
```swift
func apply(toState state: inout State, context: ApplyContext<WorkflowType>) -> Output?
```
which mirrors the `render()` API, but uses a new `ApplyContext`
parameter to expose access to the runtime-managed data. the public API
for `ApplyContext` exposes a read-only subscript for accessing Workflow
values via keypath:
```swift
public struct ApplyContext<WorkflowType: Workflow> {
public subscript<Value>(
workflowValue keyPath: KeyPath<WorkflowType, Value>
) -> Value
}
```
---
for reviewing purposes, i'd suggest using the 'commit filter' function
to exclude the commit labeled 'AUTOMATED' as that one is essentially
just noise where a bunch of new parameters were added.
also, there's definitely some more documentation to be written here, but
i've currently punted on that somewhat. do feel free to point out places
you'd like to see anything specific though.1 parent e3a157c commit 876e575
File tree
58 files changed
+536
-93
lines changed- Samples
- AsyncWorker/Sources
- ObservableComposition/Sources
- SampleApp/Sources
- SplitScreenContainer/DemoApp
- TicTacToe/Sources
- Authentication
- Game
- Main
- Tutorial/Frameworks
- Tutorial1Complete/Sources/Welcome
- Tutorial2Complete/Sources
- Todo/List
- Welcome
- Tutorial3Complete/Sources
- Todo
- Edit
- List
- Welcome
- Tutorial4Complete/Sources
- Todo
- Edit
- List
- Welcome
- Tutorial5Complete/Sources
- Todo
- Edit
- List
- Welcome
- WorkflowCombineSampleApp/WorkflowCombineSampleApp
- Tooling/Templates/Workflow (Verbose).xctemplate
- Default
- generateWorkerReactiveSwift
- generateWorkerRxSwift
- WorkflowReactiveSwift/Sources
- WorkflowRxSwift/Tests
- WorkflowTesting
- Sources
- Internal
- Tests
- Workflow
- Sources
- Tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
58 files changed
+536
-93
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
0 commit comments