Thanks for this! I was fairly new to observables so this helped out!
I had one remark though: why the x >= current && x < next statements, when you can just start at the largest breakpoint and descend, skipping the upper bound check on the lower breakpoints.
Thanks for this! I was fairly new to observables so this helped out!
I had one remark though: why the
x >= current && x < next
statements, when you can just start at the largest breakpoint and descend, skipping the upper bound check on the lower breakpoints.the result would be the same, but it's a lot shorter and a lot easier to wrap your head around.