-
-
Save Daltonic/0d1a851fe8580b76fa2c369202f6ceec to your computer and use it in GitHub Desktop.
Dapp Votes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ContestantStruct, GlobalState, PollStruct } from '@/utils/types' | |
import { PayloadAction } from '@reduxjs/toolkit' | |
export const globalActions = { | |
setWallet: (state: GlobalState, action: PayloadAction<string>) => { | |
state.wallet = action.payload | |
}, | |
setCreateModal: (state: GlobalState, action: PayloadAction<string>) => { | |
state.createModal = action.payload | |
}, | |
setUpdateModal: (state: GlobalState, action: PayloadAction<string>) => { | |
state.updateModal = action.payload | |
}, | |
setDeleteModal: (state: GlobalState, action: PayloadAction<string>) => { | |
state.deleteModal = action.payload | |
}, | |
setContestModal: (state: GlobalState, action: PayloadAction<string>) => { | |
state.contestModal = action.payload | |
}, | |
setChatModal: (state: GlobalState, action: PayloadAction<string>) => { | |
state.chatModal = action.payload | |
}, | |
setPolls: (state: GlobalState, action: PayloadAction<PollStruct[]>) => { | |
state.polls = action.payload | |
}, | |
setPoll: (state: GlobalState, action: PayloadAction<PollStruct>) => { | |
state.poll = action.payload | |
}, | |
setGroup: (state: GlobalState, action: PayloadAction<any>) => { | |
state.group = action.payload | |
}, | |
setContestants: (state: GlobalState, action: PayloadAction<ContestantStruct[]>) => { | |
state.contestants = action.payload | |
}, | |
setCurrentUser: (state: GlobalState, action: PayloadAction<any>) => { | |
state.currentUser = action.payload | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment