Skip to content

Commit

Permalink
feat(bare-flow): runtime check that deploy function has been called once
Browse files Browse the repository at this point in the history
  • Loading branch information
ElonH committed May 15, 2020
1 parent 2d5ebc6 commit 45c4f20
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app/@dataflow/core/bare-flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export abstract class BareFlow {
public abstract prerequest$: Observable<DataFlowNode>;
protected abstract request(pre: DataFlowNode): Observable<DataFlowNode>;
private bareData$: Observable<DataFlowNode>;
private deployed = false;
public deploy() {
this.bareData$ = this.prerequest$.pipe(
switchMap(
Expand All @@ -16,8 +17,10 @@ export abstract class BareFlow {
}
)
);
this.deployed = true;
}
public getOutput(): Observable<DataFlowNode> {
if (!this.deployed) throw new Error('run deploy before getOutput');
return this.bareData$;
}
}

0 comments on commit 45c4f20

Please sign in to comment.