Skip to content

Commit

Permalink
fix: adjust the useField options to be less strict
Browse files Browse the repository at this point in the history
  • Loading branch information
logaretm committed Feb 14, 2020
1 parent d099253 commit 7ea8263
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/core/src/useField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import { createFlags, normalizeRules, extractLocators } from './utils';
import { normalizeEventValue } from './utils/events';

interface FieldOptions {
value?: Ref<any>;
immediate?: boolean;
form?: FormController;
}

interface CompleteFieldOptions {
value: Ref<any>;
immediate?: boolean;
form?: FormController;
Expand Down Expand Up @@ -75,7 +81,7 @@ export function useField(fieldName: MaybeReactive<string>, rules: RuleExpression
return field;
}

function useFieldOptions(opts: FieldOptions | undefined): FieldOptions {
function useFieldOptions(opts: FieldOptions | undefined): CompleteFieldOptions {
const defaults = () => ({
value: ref(null),
immediate: false,
Expand Down

0 comments on commit 7ea8263

Please sign in to comment.