You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This feature would allow a reducer to resolve a transform at different levels. This means a transformation can be prematurely exited with a given value or it can be resolved to a new entity id.
API:
Resolve the current Transform with:
given value: accumulator.resolveTransformWith(value:*)
given entityId: accumulator.resolveTransformTo(entityId:string)
Implementation examples:
Using accumulator.resolveTransformWith to resolve a transform with a given value.
dataPoint.transform([()=>'foo',(acc)=>acc.resolveTransformWith('bar')(acc)=>'will not execute']).then(acc=>console.log(acc.value))// should output: 'bar'
Using accumulator.resolveTransformTo to resolve a transform to another transform.
dataPoint.addEntities({'transform:foo': ()=>'foo','transform:bar': ()=>'bar'})dataPoint.transform([()=>'useFoo',(acc)=>{acc.value==='useFoo'
? acc.resolveTransformTo('transform:foo')
: acc.resolveTransformTo('transform:bar')}]).then(acc=>console.log(acc.value))// should output: 'foo'
The text was updated successfully, but these errors were encountered:
I don't think we should implement the accumulator.resolveTransformTo method, because it makes entity resolution much more unpredictable. Currently we can look at the static definitions and figure out the possible resolution paths (even with control entities), but that would be much more difficult if resolveTransformTo is being used (or even impossible if the method gets passed a dynamic entityId using a variable).
SPEC IS WORK IN PROGRESS
This feature would allow a reducer to resolve a transform at different levels. This means a transformation can be prematurely exited with a given value or it can be resolved to a new entity id.
API:
Resolve the current Transform with:
accumulator.resolveTransformWith(value:*)
accumulator.resolveTransformTo(entityId:string)
Implementation examples:
Using
accumulator.resolveTransformWith
to resolve a transform with a given value.Using
accumulator.resolveTransformTo
to resolve a transform to another transform.The text was updated successfully, but these errors were encountered: