Skip to content

Instantly share code, notes, and snippets.

@dbrattli
Created October 16, 2018 20:31
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 dbrattli/760faaec985c4babed21ca49133ea0ea to your computer and use it in GitHub Desktop.
Save dbrattli/760faaec985c4babed21ca49133ea0ea to your computer and use it in GitHub Desktop.
Observable
type OnNext<'a> = 'a -> unit
type Observable<'a> =
Observable of (OnNext<'a> -> unit) with
static member Single (value: 'a) =
let subscribe (onNext: OnNext<'a>) =
onNext value
Observable subscribe
member this.Subscribe (onNext: OnNext<'a>) : unit =
match this with Observable subscribe -> subscribe onNext
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment