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 @@ -169,21 +169,14 @@ namespace TestHotUpdate {
169169 } ) ;
170170}
171171
172- namespace TestEvents {
172+ namespace TestSubscribe {
173173 const store = createStore ( ) ;
174174
175175 const handler = ( mutation : Vuex . MutationObject < any > , state : ISimpleState ) => {
176176 state . count += 1 ;
177177 } ;
178178
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 ) ;
187180}
188181
189182namespace TestLogger {
You can’t perform that action at this time.
0 commit comments