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 {
1616 modules ?: ModuleTree ;
1717 } ) : void ;
1818
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 ;
2320 }
2421
2522 function install ( Vue : vuejs . VueStatic ) : void ;
Original file line number Diff line number Diff line change @@ -191,21 +191,14 @@ namespace TestHotUpdate {
191191 } ) ;
192192}
193193
194- namespace TestEvents {
194+ namespace TestSubscribe {
195195 const store = createStore ( ) ;
196196
197197 const handler = ( mutation : Vuex . MutationObject < any > , state : ISimpleState ) => {
198198 state . count += 1 ;
199199 } ;
200200
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 ) ;
209202}
210203
211204namespace TestLogger {
You can’t perform that action at this time.
0 commit comments