From 2e10984417dafcd0230d121972c93257f57dd4af Mon Sep 17 00:00:00 2001 From: Srdan Rasic Date: Sat, 22 Jun 2019 09:59:23 +0200 Subject: [PATCH] `send` convenience when element is Void. --- Sources/Subjects.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Sources/Subjects.swift b/Sources/Subjects.swift index 3f03708..44173aa 100644 --- a/Sources/Subjects.swift +++ b/Sources/Subjects.swift @@ -52,6 +52,14 @@ extension SubjectProtocol { } } +extension SubjectProtocol where Element == Void { + + /// Convenience method to send `.next` event. + public func send() { + send(()) + } +} + /// A type that is both a signal and an observer. open class Subject: SubjectProtocol {