Reactive programming utility function that defines a property on a target object to depend on the values of other properties. Uses object getters & setters.
Strawman:
// Returns result of first run.
dependentKeys(
[ target, 'targetKey' ],
[ object1, 'key1' ],
[ object2, 'key2' ],
(key1, key2) => key1 + key2)
The first pair is the target, and the function receives arguments from the other properties. This assigns target.targetKey
whenever key1
or key2
gets assigned to.