@@ -20,6 +20,7 @@ import CompressedAsyncStorage from '../storage/CompressedAsyncStorage';
20
20
import createMigration from '../redux-persist-migrate/index' ;
21
21
import { getGlobalSession , getGlobalSettings } from '../directSelectors' ;
22
22
import { migrations } from '../storage/migrations' ;
23
+ import type { GlobalThunkExtras } from '../reduxTypes' ;
23
24
24
25
if ( process . env . NODE_ENV === 'development' ) {
25
26
// Chrome dev tools for Immutable.
@@ -72,14 +73,23 @@ export const cacheKeys: $ReadOnlyArray<$Keys<GlobalState>> = [
72
73
'realm' , 'streams' , 'subscriptions' , 'unread' , 'userGroups' , 'users' ,
73
74
] ;
74
75
75
- const thunkExtras : ThunkExtras = {
76
+ const thunkExtras : $Exact < ThunkExtras > = {
76
77
// eslint-disable-next-line no-use-before-define
77
78
getGlobalSession : ( ) = > getGlobalSession ( store . getState ( ) ) ,
78
79
79
80
// eslint-disable-next-line no-use-before-define
80
81
getGlobalSettings : ( ) => getGlobalSettings ( store . getState ( ) ) ,
81
82
} ;
82
83
84
+ const globalThunkExtras: $Exact< GlobalThunkExtras > = Object.freeze({
85
+ // TODO add things
86
+ } );
87
+
88
+ const combinedThunkExtras: ThunkExtras & GlobalThunkExtras = {
89
+ ...thunkExtras ,
90
+ ...globalThunkExtras ,
91
+ } ;
92
+
83
93
/**
84
94
* Return a list of Redux middleware objects to use in our Redux store.
85
95
*
@@ -97,7 +107,7 @@ function listMiddleware() {
97
107
// Handle the fancy "thunk" actions we often use, i.e. async
98
108
// functions of `dispatch` and `state`. See docs:
99
109
// https://github.com/reduxjs/redux-thunk
100
- thunkMiddleware . withExtraArgument ( thunkExtras ) ,
110
+ thunkMiddleware . withExtraArgument ( combinedThunkExtras ) ,
101
111
] ;
102
112
103
113
if ( config . enableReduxLogging ) {
0 commit comments