MCPcopy Create free account
hub / github.com/eclipsesource/jsonforms / onChange

Function onChange

packages/examples/src/examples/onChange.ts:40–52  ·  view source on GitHub ↗
(dispatch: Dispatch<AnyAction>)

Source from the content-addressed store, hash-verified

38
39export const onChange =
40 (dispatch: Dispatch<AnyAction>) =>
41 (_: any) =>
42 ({ data, errors }: Pick<JsonFormsCore, 'data' | 'errors'>) => {
43 Object.keys(data).forEach((key) => (touchedProperties[key] = true));
44
45 const newErrors = errors.filter((error) => {
46 return touchedProperties[(error as any).dataPath ?? error.instancePath];
47 });
48
49 if (newErrors.length < errors.length) {
50 return dispatch(updateErrors(newErrors));
51 }
52 };
53
54export const schema = {
55 type: 'object',

Callers

nothing calls this directly

Calls 3

updateErrorsFunction · 0.90
dispatchFunction · 0.85
filterMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…