Skip to content

Commit 90259f7

Browse files
authored
Merge pull request #238 from RxSwiftCommunity/freshen-up-docs
Updates the docs
2 parents 55f5da0 + bb70698 commit 90259f7

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

License.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015 Ash Furrow
3+
Copyright (c) 2021 Ash Furrow
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Readme.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ This library is used with [RxSwift](https://github.com/ReactiveX/RxSwift) to pro
77

88
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.
99

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:
1113

1214
- 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.
1416
- Aggregates next/error events across individual executions.
1517

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 👍
1719

1820
Usage
1921
-----
@@ -46,7 +48,7 @@ action: Action<String, Bool> = Action(enabledIf: validEmailAddress, workFactory:
4648

4749
Now `execute()` only does the work if the email address is valid. Super cool!
4850

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.)
5052

5153
What's _really_ cool is the `UIButton` extension. It accepts a `CocoaAction`, which is just `Action<Void, Void>`.
5254

@@ -100,15 +102,15 @@ Then run `pod install` and that'll be 👌
100102
Add this to `Cartfile`
101103

102104
```
103-
github "RxSwiftCommunity/Action" ~> 4.0.0
105+
github "RxSwiftCommunity/Action" ~> 5.0.0
104106
```
105107

106108
If you are using RxSwift 3.2.0 or below, Use Action `~2.2.0` instead!
107109

108110
then run
109111

110-
```
111-
$ carthage update
112+
```sh
113+
> carthage update
112114
```
113115

114116
Thanks

0 commit comments

Comments
 (0)