Skip to content

Instantly share code, notes, and snippets.

@Daltonic
Created December 19, 2023 12:57
Show Gist options
  • Save Daltonic/c2217eff616b28a2261888ba77c236e7 to your computer and use it in GitHub Desktop.
Save Daltonic/c2217eff616b28a2261888ba77c236e7 to your computer and use it in GitHub Desktop.
Dapp Funds
import { CharityStruct, GlobalState, SupportStruct } from '@/utils/type.dt'
import { PayloadAction } from '@reduxjs/toolkit'
export const globalActions = {
setCharities: (state: GlobalState, action: PayloadAction<CharityStruct[]>) => {
state.charities = action.payload
},
setCharity: (state: GlobalState, action: PayloadAction<CharityStruct | null>) => {
state.charity = action.payload
},
setSupports: (state: GlobalState, action: PayloadAction<SupportStruct[]>) => {
state.supports = action.payload
},
setDeleteModal: (state: GlobalState, action: PayloadAction<string>) => {
state.deleteModal = action.payload
},
setDonorModal: (state: GlobalState, action: PayloadAction<string>) => {
state.donorsModal = action.payload
},
setSupportModal: (state: GlobalState, action: PayloadAction<string>) => {
state.supportModal = action.payload
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment