File tree 2 files changed +3
-13
lines changed
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 @@ -191,21 +191,14 @@ namespace TestHotUpdate {
191
191
} ) ;
192
192
}
193
193
194
- namespace TestEvents {
194
+ namespace TestSubscribe {
195
195
const store = createStore ( ) ;
196
196
197
197
const handler = ( mutation : Vuex . MutationObject < any > , state : ISimpleState ) => {
198
198
state . count += 1 ;
199
199
} ;
200
200
201
- store . on ( 'mutation' , handler ) ;
202
- store . once ( 'mutation' , handler ) ;
203
-
204
- store . off ( ) ;
205
- store . off ( 'mutation' ) ;
206
- store . off ( 'mutation' , handler ) ;
207
-
208
- store . emit ( 'some-event' , 1 , 'a' , [ ] ) ;
201
+ store . subscribe ( handler ) ;
209
202
}
210
203
211
204
namespace TestLogger {
You can’t perform that action at this time.
0 commit comments