-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add completed and started signals to Action #105
Add completed and started signals to Action #105
Conversation
@@ -14,6 +14,26 @@ extension Action { | |||
public static var rex_disabled: Action { | |||
return Action(enabledIf: ConstantProperty(false)) { _ in .empty } | |||
} | |||
|
|||
/// Whether the action execution was completed succesfully. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have a typo here.
succesfully
→ successfully
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Fixed it.
@larryonoff I really like this! Could you add some tests as well? |
Sure. Will do it a bit later. |
@RuiAAPeres Just added tests. |
|
||
func testCompleted() { | ||
let (producer, sink) = SignalProducer<Int, TestError>.buffer(Int.max) | ||
let action = Action { producer } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you change sink
to observer
. The sink
nomenclature was abandoned a while back. (ReactiveCocoa/ReactiveCocoa#2475)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Will do it in 2 hours.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@larryonoff could you rebase? |
86f0459
to
b3b6e29
Compare
@RuiAAPeres rebase done. |
What's in this pull request?
This PR adds
completed
andstarted
signals toAction
. I often use emptyAction
as a trigger that some logic should begin executing. So these two properties were introduced.