Skip to content

Commit 73a9e82

Browse files
committed
enabledIf parameter.
1 parent ca1d002 commit 73a9e82

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

Action.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public final class Action<Input, Element> {
5050
private let executingQueue = dispatch_queue_create("com.ashfurrow.Action.executingQueue", DISPATCH_QUEUE_SERIAL)
5151
private let disposeBag = DisposeBag()
5252

53-
public init(enabledIf: Observable<BooleanType>, workFactory: WorkFactory) {
53+
public init<B: BooleanType>(enabledIf: Observable<B>, workFactory: WorkFactory) {
5454
self._enabledIf = enabledIf.map { booleanType in
5555
return booleanType.boolValue
5656
}

Changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ Current master
66

77
Nothing yet!
88

9+
0.2.1
10+
-----
11+
12+
- Fixes `enabledIf:` parameter to be `Observable<B>`, `where B: BooleanType`.
13+
914
0.2.0
1015
-----
1116

Demo/DemoTests/ButtonTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class ButtonTests: QuickSpec {
109109
}
110110
}
111111

112-
func emptyAction(enabledIf: Observable<BooleanType> = just(true)) -> CocoaAction {
112+
func emptyAction(enabledIf: Observable<Bool> = just(true)) -> CocoaAction {
113113
return CocoaAction(enabledIf: enabledIf, workFactory: { _ in
114114
return empty()
115115
})

0 commit comments

Comments
 (0)