From e581b14dff828f4fe6a465c53362982319f8db26 Mon Sep 17 00:00:00 2001 From: Dmitry Sharshakov Date: Mon, 28 Oct 2019 03:54:33 +0300 Subject: [PATCH] feat(apiApp): return app from provide method for chaining (#393) --- packages/runtime-core/src/apiApp.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/runtime-core/src/apiApp.ts b/packages/runtime-core/src/apiApp.ts index da3d50b9..d7fa2b5a 100644 --- a/packages/runtime-core/src/apiApp.ts +++ b/packages/runtime-core/src/apiApp.ts @@ -21,7 +21,7 @@ export interface App { rootContainer: HostElement | string, rootProps?: Data ): ComponentPublicInstance - provide(key: InjectionKey | string, value: T): void + provide(key: InjectionKey | string, value: T): this } export interface AppConfig { @@ -169,6 +169,8 @@ export function createAppAPI( // TypeScript doesn't allow symbols as index type // https://github.com/Microsoft/TypeScript/issues/24587 context.provides[key as string] = value + + return app } }