Skip to content

[Refactor] Refactor Flow to use save & restore pattern for handling flow switching #2506

Open
@MaxGraey

Description

@MaxGraey

See original proposal in this comment
But instead lock / unlock perhaps better to use save / restore names

// save prev flow
const currFlow = this.currentFlow;

currFlow.save();
// Fork and implicitly set this.currentFlow to this fork
var trueBranchFlow = currFlow.toBranch(prevFlow, condExpr, ConditionKind.True);

// do some work with `someFlow`

currFlow.restore(); // release trueBranchFlow's locals and restore previous flow

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions