oakes / odoyle-rules

A rules engine for Clojure(Script)
The Unlicense
530 stars 20 forks source link

Is it possible to pass the old triplet value to then block? #34

Open drewverlee opened 5 months ago

drewverlee commented 5 months ago

The :then conditional in the what block receives the old triplet value so can compare it to the new one.

If that old value could be passed to the then block, it could be used to do incremental updates to aggregates.

So instead of creating a derived list of values, then summing them, if a value in that list was updated, you would subtract the old value from a total, then add the new one.

That would be ideal performance wise right?