MCPcopy Create free account
hub / github.com/HelloCSV/HelloCSV / dispatchChange

Method dispatchChange

src/importer/state.tsx:207–229  ·  view source on GitHub ↗
(dispatch: Dispatch<ImporterAction>)

Source from the content-addressed store, hash-verified

205 ]);
206
207 public async dispatchChange(dispatch: Dispatch<ImporterAction>) {
208 const shouldValidate = this.buildSteps.some((step) =>
209 InnerStateBuilder.actionTypesThatRequireValidation.has(step.type)
210 );
211
212 const runId = generateValidationRunId();
213
214 if (shouldValidate) {
215 dispatch({ type: 'VALIDATION_STARTED', payload: { runId } });
216 }
217
218 this.buildSteps.forEach((step) => {
219 dispatch(step);
220 });
221
222 if (shouldValidate) {
223 const finalState = await this.getState();
224 dispatch({
225 type: 'VALIDATION_COMPLETED',
226 payload: { errors: finalState.validationErrors, runId },
227 });
228 }
229 }
230}

Callers 6

onFileUploadedFunction · 0.80
onEnterDataManuallyFunction · 0.80
onMappingsChangedFunction · 0.80
onMappingsSetFunction · 0.80
onCellChangedFunction · 0.80
onRemoveRowsFunction · 0.80

Calls 2

generateValidationRunIdFunction · 0.90
getStateMethod · 0.80

Tested by

no test coverage detected