diff --git a/Changelog.md b/Changelog.md
index 98d1ca1b..7f133f11 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -5,7 +5,7 @@ Changelog
Current master
--------------
-- Nothing yet!
+- Adding syntax sugar `execute()` method on `Action` when `Input` is `Void`. [#171](https://github.com/RxSwiftCommunity/Action/pull/171)
3.9.1
-----
diff --git a/Sources/Action/Action.swift b/Sources/Action/Action.swift
index 8ed51961..08cf5101 100644
--- a/Sources/Action/Action.swift
+++ b/Sources/Action/Action.swift
@@ -135,3 +135,10 @@ public final class Action {
return subject.asObservable()
}
}
+
+extension Action where Input == Void {
+ @discardableResult
+ public func execute() -> Observable {
+ return execute(())
+ }
+}
diff --git a/Sources/Action/UIKitExtensions/UIAlertAction+Action.swift b/Sources/Action/UIKitExtensions/UIAlertAction+Action.swift
index 5b4cea0e..6ccde03f 100644
--- a/Sources/Action/UIKitExtensions/UIAlertAction+Action.swift
+++ b/Sources/Action/UIKitExtensions/UIAlertAction+Action.swift
@@ -13,7 +13,7 @@ public extension UIAlertAction {
public static func Action(_ title: String?, style: ActionStyle) -> UIAlertAction {
return UIAlertAction(title: title, style: style, handler: { action in
- action.rx.action?.execute(())
+ action.rx.action?.execute()
return
})
}
diff --git a/Sources/Action/UIKitExtensions/UIBarButtonItem+Action.swift b/Sources/Action/UIKitExtensions/UIBarButtonItem+Action.swift
index 63977f1e..500818c8 100644
--- a/Sources/Action/UIKitExtensions/UIBarButtonItem+Action.swift
+++ b/Sources/Action/UIKitExtensions/UIBarButtonItem+Action.swift
@@ -31,7 +31,7 @@ public extension Reactive where Base: UIBarButtonItem {
.disposed(by: self.base.actionDisposeBag)
self.tap.subscribe(onNext: {
- action.execute(())
+ action.execute()
})
.disposed(by: self.base.actionDisposeBag)
}