File tree Expand file tree Collapse file tree 4 files changed +8
-1
lines changed
Expand file tree Collapse file tree 4 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ declare interface GlobalAPI {
1616 component : ( id : string , def ?: Class < Component > | Object) => Class < Component > ;
1717 filter: (id: string, def?: Function) => Function | void ;
1818
19+ observable : < T > (value: T) => T ;
20+
1921 // allow dynamic method registration
2022 [ key : string ] : any
2123} ;
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export function initGlobalAPI (Vue: GlobalAPI) {
4646 Vue . nextTick = nextTick
4747
4848 // 2.6 explicit observable API
49- Vue . observable = ( obj : any ) : any => {
49+ Vue . observable = < T > (obj: T ): T => {
5050 observe ( obj )
5151 return obj
5252 }
Original file line number Diff line number Diff line change @@ -200,3 +200,6 @@ declare function decorate<VC extends typeof Vue>(v: VC): VC;
200200class Decorated extends Vue {
201201 a = 123 ;
202202}
203+
204+ const obj = Vue . observable ( { a : 1 } )
205+ obj . a ++
Original file line number Diff line number Diff line change @@ -119,6 +119,8 @@ export interface VueConstructor<V extends Vue = Vue> {
119119 staticRenderFns : ( ( ) => VNode ) [ ] ;
120120 } ;
121121
122+ observable < T > ( obj : T ) : T ;
123+
122124 config : VueConfiguration ;
123125}
124126
You can’t perform that action at this time.
0 commit comments