Skip to content

Instantly share code, notes, and snippets.

@illescasDaniel
Created February 25, 2020 08:04
Show Gist options
  • Select an option

  • Save illescasDaniel/7c09e63a854dcbf2d2f9a68b87777d75 to your computer and use it in GitHub Desktop.

Select an option

Save illescasDaniel/7c09e63a854dcbf2d2f9a68b87777d75 to your computer and use it in GitHub Desktop.
Stream example swift
class Stream<T> {
var handler: ((T) -> Void)?
func emitValue(_ value: T) {
handler?(value)
}
func listen(_ handler: @escaping (T) -> Void) {
self.handler = handler
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment