SodiumFRP / sodium

Sodium - Functional Reactive Programming (FRP) Library for multiple languages
http://sodium.nz/
Other
850 stars 140 forks source link

Should SwitchEarlyS Be Removed? #134

Closed jam40jeff closed 6 years ago

jam40jeff commented 6 years ago

@the-real-blackh I added SwitchEarlyS to the C# version of Sodium a while back before DiscreteCell<T> (now Cell<T>) was added. It was needed in an attempt to emulate the Values stream for a cell without modifying the library (and without using the Operational class). It works the same as SwitchS except that it will catch simultaneous firings on a stream being switched into a cell, whereas SwitchS catches firings on the stream being switched out (which is more "natural" as cells keep their original value until the end of a transaction). Do you see any value in keeping SwitchEarlyS around? I have found no use for it since the addition of discrete cells. I am always hesitant to remove something from the public API, but this never made it into any other language (other than F#) as far as I know and I doubt anyone has used it. If you don't see a need for it, I think I would prefer removing it to simplify the API.

the-real-blackh commented 6 years ago

Yes, I'm in favour of removing it.