Skip to content

Commit

Permalink
Merge pull request #87 from MeasureAuthoringTool/feature/MAT-7338-upd…
Browse files Browse the repository at this point in the history
…ate-testcases-util-func

MAT-7338: add a utility function to update the measure store when onl…
  • Loading branch information
nmorasb authored Jun 26, 2024
2 parents 73a4978 + c778567 commit fed3d56
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Store/measureStore.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import { BehaviorSubject } from "rxjs";
import { Measure } from "@madie/madie-models/dist/Measure";
import { TestCase } from "@madie/madie-models";

// immutable object that retains state, tracks updates
const subject = new BehaviorSubject<Measure | null>(null);
Expand All @@ -18,6 +19,10 @@ export const measureStore = {
state = Object.assign({}, measure);
subject.next(state);
},
updateTestCases: (testCases: TestCase[] | null) => {
state = { ...state, testCases };
subject.next(state);
},
initialState,
state,
};

0 comments on commit fed3d56

Please sign in to comment.