BufferedValue is a utility class that holds a value and allows for efficient updates
by checking if the new value is different from the current one using a custom (deep) equality function.
If the values are different, it updates the value and returns true; otherwise, it returns false.
This allows for reference stable values that can be used in contexts where reference equality is important,
such as events or React state updates.
Param: value
The initial value to be buffered.
Param: equalityFn
An optional custom equality function to compare values.
Defaults to a deep equality check using fast-deep-equal.
BufferedValue is a utility class that holds a value and allows for efficient updates by checking if the new value is different from the current one using a custom (deep) equality function. If the values are different, it updates the value and returns true; otherwise, it returns false. This allows for reference stable values that can be used in contexts where reference equality is important, such as events or React state updates.
Param: value
The initial value to be buffered.
Param: equalityFn
An optional custom equality function to compare values. Defaults to a deep equality check using
fast-deep-equal
.