File tree 2 files changed +11
-6
lines changed
2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 5
5
* subset of node.js types, safe to use in browser and bundlers
6
6
* we do not use `lib.dom` types because they are not available in SSR environment
7
7
*/
8
- declare const process : { env : { NODE_ENV ?: string } } ;
9
- declare const console : { warn : ( ...args : Array < any > ) => void } ;
8
+ declare global {
9
+ const process : { env : { NODE_ENV ?: string } } ;
10
+ const console : { warn : ( ...args : Array < any > ) => void } ;
11
+ }
12
+
13
+ // dummy export to make typescript treat this file as ES module
14
+ export { } ;
Original file line number Diff line number Diff line change @@ -84,22 +84,22 @@ export function createActions<T>({
84
84
return {
85
85
setFiltering ( filteringText ) {
86
86
dispatch ( { type : 'filtering' , filteringText } ) ;
87
- collectionRef . current && collectionRef . current . scrollToTop ( ) ;
87
+ collectionRef . current ? .scrollToTop ( ) ;
88
88
} ,
89
89
setSorting ( state : SortingState < T > ) {
90
90
dispatch ( { type : 'sorting' , sortingState : state } ) ;
91
- collectionRef . current && collectionRef . current . scrollToTop ( ) ;
91
+ collectionRef . current ? .scrollToTop ( ) ;
92
92
} ,
93
93
setCurrentPage ( pageIndex : number ) {
94
94
dispatch ( { type : 'pagination' , pageIndex } ) ;
95
- collectionRef . current && collectionRef . current . scrollToTop ( ) ;
95
+ collectionRef . current ? .scrollToTop ( ) ;
96
96
} ,
97
97
setSelectedItems ( selectedItems : Array < T > ) {
98
98
dispatch ( { type : 'selection' , selectedItems } ) ;
99
99
} ,
100
100
setPropertyFiltering ( query : PropertyFilterQuery ) {
101
101
dispatch ( { type : 'property-filtering' , query } ) ;
102
- collectionRef . current && collectionRef . current . scrollToTop ( ) ;
102
+ collectionRef . current ? .scrollToTop ( ) ;
103
103
} ,
104
104
setExpandedItems ( expandedItems : ReadonlyArray < T > ) {
105
105
dispatch ( { type : 'expansion' , expandedItems } ) ;
You can’t perform that action at this time.
0 commit comments