// src/store/index.js import { configureStore } from '@reduxjs/toolkit'; import communityDataReducer from './slices/communityDataSlice'; import posthogReducer from './slices/posthogSlice'; import industryReducer from './slices/industrySlice'; import stockReducer from './slices/stockSlice'; import authModalReducer from './slices/authModalSlice'; import posthogMiddleware from './middleware/posthogMiddleware'; export const store = configureStore({ reducer: { communityData: communityDataReducer, posthog: posthogReducer, // ✅ PostHog Redux 状态管理 industry: industryReducer, // ✅ 行业分类数据管理 stock: stockReducer, // ✅ 股票和事件数据管理 authModal: authModalReducer, // ✅ 认证弹窗状态管理 }, middleware: (getDefaultMiddleware) => getDefaultMiddleware({ serializableCheck: { // 忽略这些 action types 的序列化检查 ignoredActions: [ 'communityData/fetchPopularKeywords/fulfilled', 'communityData/fetchHotEvents/fulfilled', 'posthog/trackEvent/fulfilled', // ✅ PostHog 事件追踪 'stock/fetchEventStocks/fulfilled', 'stock/fetchStockQuotes/fulfilled', ], }, }).concat(posthogMiddleware), // ✅ PostHog 自动追踪中间件 }); export default store;