forked from Archives/Athou_commafeed
use typed createAsyncThunk
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { PayloadAction, createAsyncThunk, createSlice } from "@reduxjs/toolkit"
|
||||
import { PayloadAction, createSlice } from "@reduxjs/toolkit"
|
||||
import { client } from "app/client"
|
||||
import { createAppAsyncThunk } from "app/store"
|
||||
import { ServerInfo } from "app/types"
|
||||
|
||||
interface ServerState {
|
||||
@@ -11,7 +12,7 @@ const initialState: ServerState = {
|
||||
webSocketConnected: false,
|
||||
}
|
||||
|
||||
export const reloadServerInfos = createAsyncThunk("server/infos", () => client.server.getServerInfos().then(r => r.data))
|
||||
export const reloadServerInfos = createAppAsyncThunk("server/infos", () => client.server.getServerInfos().then(r => r.data))
|
||||
export const serverSlice = createSlice({
|
||||
name: "server",
|
||||
initialState,
|
||||
|
||||
Reference in New Issue
Block a user