refactor(reactivity): simplify effect options

This commit is contained in:
Evan You
2019-10-30 11:11:23 -04:00
parent c6cbca25fe
commit 247c53672d
3 changed files with 17 additions and 22 deletions

View File

@@ -27,10 +27,12 @@ export type ComponentObjectPropsOptions<P = Data> = {
export type Prop<T> = PropOptions<T> | PropType<T>
type DefaultFactory<T> = () => T | null | undefined
interface PropOptions<T = any> {
type?: PropType<T> | true | null
required?: boolean
default?: T | null | undefined | (() => T | null | undefined)
default?: T | DefaultFactory<T> | null | undefined
validator?(value: unknown): boolean
}