Skip to content

Commit

Permalink
chore: make immediate option optional
Browse files Browse the repository at this point in the history
  • Loading branch information
nozomuikuta committed Jan 3, 2024
1 parent e953ad3 commit b4566a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/vue-v8n/src/composables/useV7d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import type { MaybeRefOrGetter } from 'vue'
import type { RuleDefinition, UseV7dOptions } from '../types'

export function useV7d<T>(value: T, rules: MaybeRefOrGetter<RuleDefinition[]>, options?: UseV7dOptions) {
const immediate = !!options?.immediate
const {
immediate = false
} = options || {}

const $el = ref<EventTarget>()
const _value = ref(value)
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-v8n/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type RuleFunction = (value: unknown, context: RuleContext) => string | undefined
export interface RuleContext {}

export interface UseV7dOptions {
immediate: boolean
immediate?: boolean
}

export interface VueV8nOptions {}
Expand Down

0 comments on commit b4566a7

Please sign in to comment.