Fork me on GitHub
#hoplon
<
2017-09-24
>
thedavidmeister15:09:17

@flyboarder no, it's the opposite, there's never a need to not propagate, so there's no need to check if the value has changed

thedavidmeister15:09:40

it's a tradeoff that javelin makes

thedavidmeister15:09:12

that normally the time saved by not propagating values that haven't changed will outweigh the cost of the equality check to decide if the value did change

thedavidmeister15:09:15

in the case of a cell that wraps a db with no extra logic (the conn in datascript is normally an atom, but it works the same way) then as soon as i write to the db then i know it should propagate, no need to check what i already know by scanning the whole db row by row 🙂

thedavidmeister15:09:21

@dm3 i haven't looked at the code as deeply as you have (not at all yet :P), i wonder if this could be as simple as running the equality check on cell= but not cell? when a cell changes it would have to be in response to a swap! or reset! so, seems like an OK assumption to just forward the value on without testing it?

dm316:09:34

I think the best approach is to have a customizable equality predicate

dm316:09:09

your suggestion makes sense - we could skip propagation on input cell reset

dm316:09:25

when the value is the same