Skip to content

Commit

Permalink
add debug labels
Browse files Browse the repository at this point in the history
  • Loading branch information
MiroslavPetrik committed Feb 19, 2023
1 parent 8a1d178 commit 2d43420
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/field/src/field/field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,17 @@ export const validatedFieldAtom = <Value>({
const validatedAtom = atom((get) => {
const baseField = get(baseFieldAtom);

baseField.value.debugLabel = `field/value/${atomConfig.name}`;
baseField.validateStatus.debugLabel = `field/validateStatus/${atomConfig.name}`;
baseField.dirty.debugLabel = `field/dirty/${atomConfig.name}`;
baseField.touched.debugLabel = `field/touched/${atomConfig.name}`;
baseField.name.debugLabel = `field/name/${atomConfig.name}`;
baseField.errors.debugLabel = `field/errors/${atomConfig.name}`;
requiredAtom.debugLabel = `field/required/${atomConfig.name}`;

return { ...baseField, required: requiredAtom };
});

validatedAtom.debugLabel = `${atomConfig.name}/validatedAtom`;
validatedAtom.debugLabel = `field/${atomConfig.name}`;
return validatedAtom;
};

0 comments on commit 2d43420

Please sign in to comment.