{"action":"closed","issue":{"url":"https://api.github.com/repos/fsprojects/FSharp.Control.Reactive/issues/61","labels_url":"https://api.github.com/repos/fsprojects/FSharp.Control.Reactive/issues/61/labels{/name}","comments_url":"https://api.github.com/repos/fsprojects/FSharp.Control.Reactive/issues/61/comments","events_url":"https://api.github.com/repos/fsprojects/FSharp.Control.Reactive/issues/61/events","html_url":"https://github.com/fsprojects/FSharp.Control.Reactive/issues/61","id":66204812,"number":61,"title":"Observable.create doesn't seem to work as expected","user":{"login":"andybrackley","id":988030,"avatar_url":"https://avatars.githubusercontent.com/u/988030?v=3","gravatar_id":"","url":"https://api.github.com/users/andybrackley","html_url":"https://github.com/andybrackley","followers_url":"https://api.github.com/users/andybrackley/followers","following_url":"https://api.github.com/users/andybrackley/following{/other_user}","gists_url":"https://api.github.com/users/andybrackley/gists{/gist_id}","starred_url":"https://api.github.com/users/andybrackley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andybrackley/subscriptions","organizations_url":"https://api.github.com/users/andybrackley/orgs","repos_url":"https://api.github.com/users/andybrackley/repos","events_url":"https://api.github.com/users/andybrackley/events{/privacy}","received_events_url":"https://api.github.com/users/andybrackley/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-03T18:33:32Z","updated_at":"2015-04-03T20:22:30Z","closed_at":"2015-04-03T20:22:30Z","body":"I have the following sample code:\r\n\r\nopen System\r\nopen FSharp.Control.Reactive\r\nopen System.Reactive.Disposables\r\nopen System.Reactive.Linq\r\n\r\nlet obs =\r\n  Observable.Create(fun (obs : IObserver<string>) -> obs.OnNext(\"www\"); Action( fun _ -> printfn \"www -> Disposing\" ) )\r\n  |> Observable.subscribe (fun x -> printfn \"%A\" x)\r\n\r\nlet obs1 = \r\n  Observable.create (fun obs -> obs.OnNext(\"xxx\"); fun _ -> ()  )\r\n  |> Observable.subscribe (fun x -> printfn \"%A\" x)\r\n\r\nlet obs2 = \r\n  Observable.createWithDisposable(fun obs -> obs.OnNext(\"yyy\") ; Disposable.Create( fun _ -> printfn \"yyy -> Disposing\" ))\r\n  |> Observable.subscribe (fun x -> printfn \"%A\" x)\r\n\r\n[<EntryPoint>]\r\nlet main argv = \r\n  use o = obs\r\n  use o1 = obs1\r\n  use o2 = obs2\r\n  0 // return an integer exit code\r\n\r\n--- This produces the output in my F# Console Application ---\r\n\"www\"\r\n\"yyy\"\r\nyyy -> Disposing\r\nwww -> Disposing\r\nPress any key to continue . . .\r\n\r\nNotice that the \"xxx\" is missing from the output.  This is the version using Observable.create from the FSharp.Reactive.Control library and it appears that the OnNext is never called.  I've tried a few variations including:\r\n\r\nlet obs1 = \r\n  Observable.create (fun obs () -> obs.OnNext(\"xxx\");  )\r\n  |> Observable.subscribe (fun x -> printfn \"%A\" x)\r\n\r\nand\r\n\r\nlet obs1 = \r\n  Observable.create (fun obs -> fun _ -> obs.OnNext(\"xxx\");  )\r\n  |> Observable.subscribe (fun x -> printfn \"%A\" x)\r\n\r\nbut can't get this to work.\r\n\r\nI've raised a StackOverflow question: http://stackoverflow.com/questions/29436180/how-do-you-use-observable-create-in-the-fsharp-control-reactive-library\r\n\r\nAm I doing something wrong or is the implementation broken?\r\n\r\nThanks"}}