Skip to content

Instantly share code, notes, and snippets.

@neonichu
Created November 30, 2015 23:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neonichu/adab929fdc48d745cf9d to your computer and use it in GitHub Desktop.
Save neonichu/adab929fdc48d745cf9d to your computer and use it in GitHub Desktop.
Slowly approaching significant Swift hipster status
func signalify<T, U, V>(p: T, _ c: (T, (Result<U>) -> ()) -> V) -> (V, Signal<U>) {
let s = Signal<U>()
let v = c(p) { s.update($0) }
return (v, s)
}
@pcperini
Copy link

neat!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment