This PR adds support for 'subplanners' - nested executions of weiroll that share their state arrays but have distinct command lists.
Example usage:
const planner = new Planner();
const subplanner = new Planner();
const sum = subplanner.add(Math.add(1, 2));
planner.addSubplan(SubcommandContract.execute(subplanner, subplanner.state));
planner.add(Events.logUint(sum));
const { commands, state} = planner.plan();
Return values from one subplan can be used in the parent scope, and even in other subplans. The planner constructs command lists for subplanners and inserts them into the state.
This PR adds support for 'subplanners' - nested executions of weiroll that share their state arrays but have distinct command lists.
Example usage:
Return values from one subplan can be used in the parent scope, and even in other subplans. The planner constructs command lists for subplanners and inserts them into the state.