feat(apiApp): return app from provide method for chaining (#393)
This commit is contained in:
parent
a8aa328907
commit
e581b14dff
@ -21,7 +21,7 @@ export interface App<HostElement = any> {
|
|||||||
rootContainer: HostElement | string,
|
rootContainer: HostElement | string,
|
||||||
rootProps?: Data
|
rootProps?: Data
|
||||||
): ComponentPublicInstance
|
): ComponentPublicInstance
|
||||||
provide<T>(key: InjectionKey<T> | string, value: T): void
|
provide<T>(key: InjectionKey<T> | string, value: T): this
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AppConfig {
|
export interface AppConfig {
|
||||||
@ -169,6 +169,8 @@ export function createAppAPI<HostNode, HostElement>(
|
|||||||
// TypeScript doesn't allow symbols as index type
|
// TypeScript doesn't allow symbols as index type
|
||||||
// https://github.com/Microsoft/TypeScript/issues/24587
|
// https://github.com/Microsoft/TypeScript/issues/24587
|
||||||
context.provides[key as string] = value
|
context.provides[key as string] = value
|
||||||
|
|
||||||
|
return app
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user