ui: typed redux

This commit is contained in:
undefined committed 2022-03-19 03:07:38 +08:00
1 parent e0f38fb0a8
commit 99b6ead86f
6 files changed
+4 -1

No files matched your search

@@ -12,3 +12,4 @@ const reducer = combineReducers({
});
export default reducer;
export type RootState = ReturnType<typeof reducer>;
@@ -1,4 +1,6 @@
export default async function loadReactRedux(storeReducer) {
import { Action, AnyAction, Reducer } from 'redux';
export default async function loadReactRedux<S, A extends Action = AnyAction>(storeReducer: Reducer<S, A>) {
const React = await import('react');
const { render, unmountComponentAtNode } = await import('react-dom');
const { Provider } = await import('react-redux');