You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "michael-s-molina (via GitHub)" <gi...@apache.org> on 2023/04/04 14:05:14 UTC

[GitHub] [superset] michael-s-molina commented on a diff in pull request #23460: refactor: introduce redux toolkit

michael-s-molina commented on code in PR #23460:
URL: https://github.com/apache/superset/pull/23460#discussion_r1157310516


##########
superset-frontend/src/views/store.ts:
##########
@@ -135,13 +120,32 @@ export const store: Store = createStore(
  * setupStore with disableDebugger true enables the menu.tsx component to avoid connecting
  * to redux debugger so the application can connect to redux debugger
  */
-export function setupStore(disableDegugger = false): Store {
-  return createStore(
-    rootReducer,
-    {},
-    compose(
-      applyMiddleware(thunk, logger),
-      initEnhancer(false, undefined, disableDegugger),
-    ),
-  );
+export function setupStore({
+  disableDebugger = false,
+  initialState = {},
+  rootReducers = reducers,
+  ...overrides
+}: {
+  disableDebugger?: boolean;
+  initialState?: ConfigureStoreOptions['preloadedState'];
+  rootReducers?: ConfigureStoreOptions['reducer'];
+} & Partial<ConfigureStoreOptions> = {}): Store {
+  return configureStore({
+    preloadedState: initialState,
+    reducer: {
+      ...rootReducers,
+    },
+    middleware: getDefaultMiddleware =>
+      getDefaultMiddleware({
+        serializableCheck: {
+          // Ignores AbortController instances
+          ignoredActionPaths: [/queryController/g],
+          ignoredPaths: [/queryController/g],
+        },
+      }).concat(logger),

Review Comment:
   ```suggestion
         getDefaultMiddleware({
           getDefaultMiddleware({
           immutableCheck: {
             warnAfter: 200,
           },
           serializableCheck: {
             // Ignores AbortController instances
             ignoredActionPaths: [/queryController/g],
             ignoredPaths: [/queryController/g],
             warnAfter: 200,
           },
         }).concat(logger),
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org