]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
feat(apiApp): return app from provide method for chaining (#393)
authorDmitry Sharshakov <d3dx12.xx@gmail.com>
Mon, 28 Oct 2019 00:54:33 +0000 (03:54 +0300)
committerEvan You <yyx990803@gmail.com>
Mon, 28 Oct 2019 00:54:33 +0000 (20:54 -0400)
packages/runtime-core/src/apiApp.ts

index da3d50b96a94261afa10f63725ace5b24c0175bb..d7fa2b5a5f99beaad8f12c5939029b41511d783e 100644 (file)
@@ -21,7 +21,7 @@ export interface App<HostElement = any> {
     rootContainer: HostElement | string,
     rootProps?: Data
   ): ComponentPublicInstance
-  provide<T>(key: InjectionKey<T> | string, value: T): void
+  provide<T>(key: InjectionKey<T> | string, value: T): this
 }
 
 export interface AppConfig {
@@ -169,6 +169,8 @@ export function createAppAPI<HostNode, HostElement>(
         // TypeScript doesn't allow symbols as index type
         // https://github.com/Microsoft/TypeScript/issues/24587
         context.provides[key as string] = value
+
+        return app
       }
     }