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
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,13 +7,15 @@ This library is used with [RxSwift](https://github.com/ReactiveX/RxSwift) to pro
7
7
8
8
An action is a way to say "hey, later I'll need you to subscribe to this thing." It's actually a lot more involved than that.
9
9
10
-
Actions accept a `workFactory`: a closure that takes some input and produces an observable. When `execute()` is called, it passes its parameter to this closure and subscribes to the work.
10
+
Actions accept a `workFactory`: a closure that takes some input and produces an observable. When `execute()` is called on the action, the `workFactory` gets passed this parameter and the action subscribes to the observable that gets returned.
11
+
12
+
An action:
11
13
12
14
- Can only be executed while "enabled" (`true` if unspecified).
13
-
- Only execute one thing at a time.
15
+
- Only executes one thing at a time.
14
16
- Aggregates next/error events across individual executions.
15
17
16
-
Oh, and it has this really swift thing with `UIButton` that's pretty cool. It'll manage the button's enabled state, make sure the button is disabled while your work is being done, all that stuff 👍
18
+
Oh, and it has this really Swift thing with `UIButton` that's pretty cool. It'll manage the button's enabled state, make sure the button is disabled while your work is being done, all that stuff 👍
Now `execute()` only does the work if the email address is valid. Super cool!
48
50
49
-
Note that `enabledIf` isn't the same as the `enabled` property. You pass in `enabledIf` and the action uses that, and its current executing state, to determine if it's currently enabled.
51
+
(Note that `enabledIf` isn't the same as the `enabled` property. You pass in `enabledIf` and the action uses that (combined with its current executing state) to determine if it's currently enabled.)
50
52
51
53
What's _really_ cool is the `UIButton` extension. It accepts a `CocoaAction`, which is just `Action<Void, Void>`.
52
54
@@ -100,15 +102,15 @@ Then run `pod install` and that'll be 👌
100
102
Add this to `Cartfile`
101
103
102
104
```
103
-
github "RxSwiftCommunity/Action" ~> 4.0.0
105
+
github "RxSwiftCommunity/Action" ~> 5.0.0
104
106
```
105
107
106
108
If you are using RxSwift 3.2.0 or below, Use Action `~2.2.0` instead!
0 commit comments