File tree Expand file tree Collapse file tree 2 files changed +3
-13
lines changed Expand file tree Collapse file tree 2 files changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,7 @@ declare namespace Vuex {
16
16
modules ?: ModuleTree ;
17
17
} ) : void ;
18
18
19
- on ( event : string , cb : ( ...args : any [ ] ) => void ) : void ;
20
- once ( event : string , cb : ( ...args : any [ ] ) => void ) : void ;
21
- off ( event ?: string , cb ?: ( ...args : any [ ] ) => void ) : void ;
22
- emit ( event : string , ...args : any [ ] ) : void ;
19
+ subscribe ( cb : ( mutation : MutationObject < any > , state : S ) => void ) : ( ) => void ;
23
20
}
24
21
25
22
function install ( Vue : vuejs . VueStatic ) : void ;
Original file line number Diff line number Diff line change @@ -169,21 +169,14 @@ namespace TestHotUpdate {
169
169
} ) ;
170
170
}
171
171
172
- namespace TestEvents {
172
+ namespace TestSubscribe {
173
173
const store = createStore ( ) ;
174
174
175
175
const handler = ( mutation : Vuex . MutationObject < any > , state : ISimpleState ) => {
176
176
state . count += 1 ;
177
177
} ;
178
178
179
- store . on ( 'mutation' , handler ) ;
180
- store . once ( 'mutation' , handler ) ;
181
-
182
- store . off ( ) ;
183
- store . off ( 'mutation' ) ;
184
- store . off ( 'mutation' , handler ) ;
185
-
186
- store . emit ( 'some-event' , 1 , 'a' , [ ] ) ;
179
+ store . subscribe ( handler ) ;
187
180
}
188
181
189
182
namespace TestLogger {
You can’t perform that action at this time.
0 commit comments