Skip to content

Commit

Permalink
send convenience when element is Void.
Browse files Browse the repository at this point in the history
  • Loading branch information
srdanrasic committed Jun 22, 2019
1 parent ef3aa40 commit 2e10984
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Sources/Subjects.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<Element, Error: Swift.Error>: SubjectProtocol {

Expand Down

0 comments on commit 2e10984

Please sign in to comment.