Currently, we can call useLDflex with LDflex strings. For example:
const image = useLDflex('user.image');
However, LDflex paths should also be possible (as is the case with the higher-order-component evaluateExpressions):
const image = useLDflex(solid.data.user.image);
The above will currently not work, because solid.data.user.image will evaluate to a new value every time it is called, triggering infinite rerenders.
This would work:
const promise = solid.data.user.image;
function render() {
const image = useLDflex(promise);
}
but that obviously creates other problems.
What we probably want is a caching feature in LDflex, such that the same paths trigger the same values (until, for instance, the cache is cleared).
Alternatively, LDflex could generate an internal key, and that key is used to conditionally trigger useEffect.
Currently, we can call
useLDflexwith LDflex strings. For example:However, LDflex paths should also be possible (as is the case with the higher-order-component
evaluateExpressions):The above will currently not work, because
solid.data.user.imagewill evaluate to a new value every time it is called, triggering infinite rerenders.This would work:
but that obviously creates other problems.
What we probably want is a caching feature in LDflex, such that the same paths trigger the same values (until, for instance, the cache is cleared).
Alternatively, LDflex could generate an internal
key, and thatkeyis used to conditionally triggeruseEffect.