raquo / Airstream

State propagation and event streams with mandatory ownership and no glitches
MIT License
246 stars 28 forks source link

split doesn't memoize on Signal[LazyList[A]] #117

Closed mattjacobus closed 5 months ago

mattjacobus commented 9 months ago

SplitSignal uses side effects in a map over the elements to keep track of which keys have been seen and since the LazyList is evaluated later, it believes no keys were seen and purges all the child signals and calls your project function on every event. You might want another implicit specifically for LazyLists that does a force.

raquo commented 9 months ago

Thanks, good find! Somehow I've never used LazyList...

I think I'll update the map method of ImmutableSeqSplittable to do something special if the input is a LazyList. Probably convert it to a strict Seq like List or ArraySeq.

raquo commented 5 months ago

This was fixed in 17.0.0, forgot to close earlier.