fsprojects / FSharp.Control.Reactive

Extensions and wrappers for using Reactive Extensions (Rx) with F#.
http://fsprojects.github.io/FSharp.Control.Reactive
Other
284 stars 58 forks source link

Make switchMap a map followed by a switch, fixes #134 #137

Closed deviousasti closed 4 years ago

panesofglass commented 4 years ago

Thank you for this PR! Does anyone know whether this adheres to the original goal of the function? Was the prior implementation an over-eager optimization?

deviousasti commented 4 years ago

switchMap in other implementations is consistent with flatMap, concatMap as a projection to a higher order observable and subsequent reduction.

The problem with the prior implementation was it tried to replicate Switch with a simple mutable. The actual implementation of Switch is non-trivial.

panesofglass commented 4 years ago

Closes #134