Skip to content

Commit 8fdc77f

Browse files
committed
fix ts store
1 parent ba80536 commit 8fdc77f

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

template/ts-support-template/src/Store/Startup/Init.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,15 @@ import {
66
import FetchOne from '@/Store/User/FetchOne'
77
import { navigateAndSimpleReset } from '@/Navigators/Root'
88
import DefaultTheme from '@/Store/Theme/DefaultTheme'
9-
import { AppDispatch } from '@/Store'
109

1110
export default {
1211
initialState: buildAsyncState(),
13-
action: buildAsyncActions(
14-
'startup/init',
15-
async (args: any, { dispatch }: { dispatch: AppDispatch }) => {
12+
action: buildAsyncActions('startup/init', async (args, { dispatch }) => {
1613
// Timeout to fake waiting some process
1714
// Remove it, or keep it if you want display a beautiful splash screen ;)
1815
await new Promise((resolve) => setTimeout(resolve, 1000))
1916
// Here we load the user 1 for example, but you can for example load the connected user
20-
await dispatch(FetchOne.action(1))
17+
await dispatch(FetchOne.action('1'))
2118
await dispatch(DefaultTheme.action({ theme: 'default', darkMode: null }))
2219
// Navigate and reset to the main navigator
2320
navigateAndSimpleReset('Main')

template/ts-support-template/src/Store/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,3 @@ const store = configureStore({
5151
const persistor = persistStore(store)
5252

5353
export { store, persistor }
54-
export type AppDispatch = typeof store.dispatch

0 commit comments

Comments
 (0)