Skip to content

Commit 335522b

Browse files
committed
docs: fix setConfig/setFieldConfig signatures - EventCallable not synchronous
- Change setConfig/setFieldConfig from (cfg) => void to EventCallable<T> - Update useForm.md, useFormMethods.md, useFormInstance.md - Update README.md - These are effector events, not synchronous functions
1 parent 1254968 commit 335522b

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,10 +342,10 @@ interface FormInstance {
342342
resetUntouched: EventCallable<string[]>;
343343
/** EVENT - Set form config */
344344
setActive: EventCallable<{ name: string; value: boolean; }>;
345-
/** METHOD - Set form config */
346-
setConfig: (cfg: IFormConfig) => void;
347-
/** METHOD - Set field config */
348-
setFieldConfig: (cfg: IFieldConfig) => void;
345+
/** EVENT - Set form config */
346+
setConfig: EventCallable<IFormConfig>;
347+
/** EVENT - Set field config */
348+
setFieldConfig: EventCallable<IFieldConfig>;
349349
/** EVENT - Form update field values */
350350
setValues: EventCallable<IRValues>;
351351
/** EVENT - Form merge errors - merges provided errors into existing $errors store */

docs-site/docs/api/useForm.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ function useForm(formName?: string): {
3838
submit: Effect<ISubmitArgs, ISubmitResponseSuccess, ISubmitResponseError>;
3939
validate: EventCallable<IValidationParams>;
4040

41-
// Config methods (synchronous)
42-
setConfig: (cfg: IFormConfig) => void;
43-
setFieldConfig: (cfg: IFieldConfig) => void;
41+
// Config methods (effector events)
42+
setConfig: EventCallable<IFormConfig>;
43+
setFieldConfig: EventCallable<IFieldConfig>;
4444
}
4545
```
4646

docs-site/docs/api/useFormInstance.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ Where `IForm` contains:
4444
// Effects
4545
submit: Effect<ISubmitArgs, ISubmitResponseSuccess, ISubmitResponseError>;
4646
47-
// Config
48-
setConfig: (cfg: IFormConfig) => void;
49-
setFieldConfig: (cfg: IFieldConfig) => void;
47+
// Config (effector events)
48+
setConfig: EventCallable<IFormConfig>;
49+
setFieldConfig: EventCallable<IFieldConfig>;
5050
}
5151
```
5252

docs-site/docs/api/useFormMethods.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ function useFormMethods(formName?: string): {
2525
submit: Effect<ISubmitArgs, ISubmitResponseSuccess, ISubmitResponseError>;
2626
validate: EventCallable<IValidationParams>;
2727

28-
// Config methods (synchronous)
29-
setConfig: (cfg: IFormConfig) => void;
30-
setFieldConfig: (cfg: IFieldConfig) => void;
28+
// Config methods (effector events)
29+
setConfig: EventCallable<IFormConfig>;
30+
setFieldConfig: EventCallable<IFieldConfig>;
3131
}
3232
```
3333

@@ -42,7 +42,7 @@ function useFormMethods(formName?: string): {
4242
Object containing form methods:
4343
- **Events**: `change`, `erase`, `reset`, `resetField`, `resetUntouched`, `setActive`, `setValues`, `setErrors`, `replaceErrors`, `validate`
4444
- **Effect**: `submit`
45-
- **Config methods**: `setConfig`, `setFieldConfig` (synchronous)
45+
- **Config methods**: `setConfig`, `setFieldConfig` (effector events)
4646

4747
## Usage Example
4848

0 commit comments

Comments
 (0)