Created
May 26, 2022 23:45
-
-
Save jasonLaster/78fa5b41b7a9c5e9f7986182a60735ed to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. passing in points to the LogpointsManager | |
// 2. dont run every analysis now | |
// Analysis Manager will be user to help our thunks conduct analysis for Logpoints and Other portions of the UI. | |
// NOTE | |
// * it will not have the store | |
// * it will be designed behave simililarly to several backend classes (i.e. async queue) | |
// * it will support the two phases of analysis (Find Points, Run Analysis) | |
// * it will use a cache to support not re-fetching the same data | |
// | |
// Decisions | |
// * should the API expose map/reduce? | |
// * should the API expose events, exceptions, and other non-source-location params | |
// Logpoints Reducer will be used to show logpoints in the UI | |
type Analysis = { | |
id: string, | |
points: TimeStampedPoint[], | |
results: {[point: ExecutionPoint]: any}, | |
error: any, | |
pending: boolean, | |
} | |
type Logpoint = { | |
location: Location, | |
expression: string, | |
condition: string, | |
primitiveExpression: boolean, | |
enabled: boolean, | |
prefix: "unicorn" | void, | |
analyses: Analysis[] | |
} | |
const logpointState = { | |
logpoints: {[locationKey: string]: Logpoint} | |
} | |
// addLogpoint | |
// removeLogpoint | |
// updateLogpoint | |
export function addLogpoint(cx: Context, line: number): UIThunkAction { | |
return (dispatch, getState, {analysisManager}) => { | |
analysisManager.runAnalysis(location, focusWindow) | |
}; | |
} | |
export function refocusLogpoint(focus): UIThunkAction { | |
return (dispatch, getState, {analysisManager}) => { | |
for (const logpoint of logpoints) { | |
analysisManager.updateAnalysis(logpoint.analysisId, focusWindow) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment