UNPKG

expo-router-redux-template

Version:

An expo template featuring expo-router, reduxjs-toolkit, react-native-reanimated, and redux-persist for cross-platform mobile app development.

18 lines (14 loc) 566 B
import { configureStore } from '@reduxjs/toolkit'; import { persistStore } from 'redux-persist'; import thunk from 'redux-thunk'; import reducer from './reducer'; // Configure and create the Redux store export const store = configureStore({ reducer, middleware: [thunk], }); // Create a persistor to enable state persistence export const persistor = persistStore(store); // Define types for RootState and AppDispatch based on the store export type RootState = ReturnType<typeof store.getState>; export type AppDispatch = typeof store.dispatch;