Skip to content

Instantly share code, notes, and snippets.

@sergdort
Last active June 3, 2017 17:07
Show Gist options
  • Save sergdort/411f208b3dc191155b984ab3a49af724 to your computer and use it in GitHub Desktop.
Save sergdort/411f208b3dc191155b984ab3a49af724 to your computer and use it in GitHub Desktop.
public final class Observer<E>: ObserverType {
private let _handler: (Event<E>) -> Void
public init(handler: @escaping (Event<E>) -> Void) {
_handler = handler
}
public func on(event: Event<E>) {
_handler(event)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment