Type aliases
Controller
Controller<State>: { actions: ActionsCanBePublic<State>; components: { Field: any; Slicer: any }; useInitialize: any; useSelector: any }
Type parameters
Type declaration
actions: ActionsCanBePublic<State>
components: { Field: any; Slicer: any }
Field:function
- Field<Name>(props: FieldProps<State, Name>): null | ReactElement<any, any>
Type parameters
Name: string | number | symbol
Parameters
Returns null | ReactElement<any, any>
Slicer:function
- Slicer<Selected>(props: SliceProps<State, Selected>): null | ReactElement<any, any>
Type parameters
Selected: readonly unknown[]
Parameters
Returns null | ReactElement<any, any>
useInitialize:function
- useInitialize(initialValue: Partial<State>): void
Parameters
initialValue: Partial<State>
Returns void
useSelector:function
- useSelector<R>(selector: (state: FullFormState<State>) => R, isEqual?: (prev: R, current: R) => boolean): R
Type parameters
Parameters
selector: (state: FullFormState<State>) => R
Optional isEqual: (prev: R, current: R) => boolean
- (prev: R, current: R): boolean
Parameters
Returns boolean
Returns R
FieldProps
FieldProps<State, Name>: { name: Name; children: any }
Type parameters
Type declaration
name: Name
children:function
- children(tool: { name: Name; value: State[Name]; onChange: any }, value: State[Name], errorMessage: null | string): ReactNode
Parameters
tool: { name: Name; value: State[Name]; onChange: any }
name: Name
value: State[Name]
onChange:function
- onChange(this: void, name: Name, value: State[Name]): void
- onChange(this: void, e: ChangeEvent<HTMLElement>): void
Parameters
this: void
name: Name
value: State[Name]
Returns void
Parameters
this: void
e: ChangeEvent<HTMLElement>
Returns void
value: State[Name]
errorMessage: null | string
Returns ReactNode
FullFormState
FullFormState<State>: FormStatus & { errors: FormErrors<State>; value: State }
Type parameters
HandleChangeAction
HandleChangeAction<State, R>: <Name>(name: Name, value: State[Name]) => R
Type parameters
Type declaration
- <Name>(name: Name, value: State[Name]): R
Type parameters
Parameters
name: Name
value: State[Name]
Returns R
SliceProps
SliceProps<State, Selected>: { children: any; selector: any }
Type parameters
Selected: ReadonlyArray<unknown>
Type declaration
children:function
- children(tool: { handleChange: HandleChangeAction<State> }, ...value: Readonly<Selected>): ReactNode
Parameters
Rest ...value: Readonly<Selected>
Returns ReactNode
selector:function
Parameters
Returns Selected
StateRestriction
StateRestriction: Record<string, any>
Restricted type interface of the form store TODO: more restriction