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
We probably don't need to create corresponding full action descriptor types, because we can probably just use local variables in the process of handling the action. Eg
functionrunAction(partialActionDescriptor: PartialActionDescriptor){switch(partialActionDescriptor.name){case"bring":
case"move":
const[sourceDescriptor,destinationTargetDescriptor]=inferFullTargets([partialActionDescriptor.source,partialActionDescriptor.destination.target,]);// Note: we don't need to worry about final stages here because bring and move don't use them!constsource=pipelineRunner.run(sourceDescriptor);constdestination=pipelineRunner.run(destinationTargetDescriptor).getDestination(partialActionDescriptor.destination.insertionMode);returnaction.run(source,destination);case"wrapWithPairedDelimiter":
// Some duplication with default case, but not tooo badconst[targetDescriptor]=inferFullTargets([partialActionDescriptor.target,]);consttarget=pipelineRunner.run(targetDescriptor);returnaction.run(target,partialActionDescriptor.left,partialActionDescriptor.right);default:
// TODO: Could prob expose `inferFullTarget` (singular) that takes single descriptor with no previousTargets// eg const targetDescriptor = inferFullTarget(partialActionDescriptor.target)const[targetDescriptor]=inferFullTargets([partialActionDescriptor.target,]);// TODO: Do we want to handle final stages in the generic case? Most// actions don't have them anyway so we might want special cases for themconsttarget=pipelineRunner.run(targetDescriptor);returnaction.run(target);}}
Fwiw if we don't need post-inference action descriptor types, then maybe we should remove Partial from these names, eg just BringMoveActionDescriptor
Note that it's also tempting to just inline the whole ActionDescriptor into the Command object itself. Not sure what the nested object is buying us here
The text was updated successfully, but these errors were encountered:
Extension side
getDestination(insertionMode: InsertionMode)
toTarget
, and have default implementation inBaseTarget
run
for actions that expect a destination to useDestination
"swap"
, it expects two actual targets (not destinations), but internally converts them to destinations when using them as such.PositionTarget
to beDestination
and stop implementingTarget
for this type, removing all unnecessary attributesedit
fromTarget
editNew
#773 while hereOn the api surface, we'd modify
ActionCommand
something like the following:We probably don't need to create corresponding full action descriptor types, because we can probably just use local variables in the process of handling the action. Eg
Fwiw if we don't need post-inference action descriptor types, then maybe we should remove
Partial
from these names, eg justBringMoveActionDescriptor
Note that it's also tempting to just inline the whole
ActionDescriptor
into theCommand
object itself. Not sure what the nested object is buying us hereThe text was updated successfully, but these errors were encountered: