Skip to content

Commit 1672883

Browse files
committed
Default ActionState.isExecuting to false
1 parent 09dba0c commit 1672883

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Sources/Action.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public final class Action<Input, Output, Error: Swift.Error> {
8888
errors = events.map { $0.error }.skipNil()
8989
completed = events.filter { $0.isCompleted }.map { _ in }
9090

91-
let initial = ActionState(isExecuting: false, value: property.value, isEnabled: { isEnabled($0 as! State.Value) })
91+
let initial = ActionState(value: property.value, isEnabled: { isEnabled($0 as! State.Value) })
9292
state = MutableProperty(initial)
9393

9494
property.signal
@@ -179,12 +179,11 @@ public final class Action<Input, Output, Error: Swift.Error> {
179179
}
180180

181181
private struct ActionState {
182-
var isExecuting: Bool
182+
var isExecuting: Bool = false
183183
var value: Any
184184
private let userEnabled: (Any) -> Bool
185185

186-
init(isExecuting: Bool, value: Any, isEnabled: @escaping (Any) -> Bool) {
187-
self.isExecuting = isExecuting
186+
init(value: Any, isEnabled: @escaping (Any) -> Bool) {
188187
self.value = value
189188
self.userEnabled = isEnabled
190189
}

0 commit comments

Comments
 (0)