feat: 提交 Redux Slice

This commit is contained in:
zdl
2025-10-30 13:03:31 +08:00
parent c77061f36d
commit 3472d267af
2 changed files with 483 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ 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 posthogMiddleware from './middleware/posthogMiddleware';
export const store = configureStore({
@@ -10,6 +11,7 @@ export const store = configureStore({
communityData: communityDataReducer,
posthog: posthogReducer, // ✅ PostHog Redux 状态管理
industry: industryReducer, // ✅ 行业分类数据管理
stock: stockReducer, // ✅ 股票和事件数据管理
},
middleware: (getDefaultMiddleware) =>
getDefaultMiddleware({
@@ -19,6 +21,8 @@ export const store = configureStore({
'communityData/fetchPopularKeywords/fulfilled',
'communityData/fetchHotEvents/fulfilled',
'posthog/trackEvent/fulfilled', // ✅ PostHog 事件追踪
'stock/fetchEventStocks/fulfilled',
'stock/fetchStockQuotes/fulfilled',
],
},
}).concat(posthogMiddleware), // ✅ PostHog 自动追踪中间件