[ABANDONED] React/Redux front end for the Flexor social network.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

38 lines
753 B

import { Action } from 'redux'
export interface StartRequestAction extends Action {
type: 'REQUESTS_START_REQUEST'
payload: {
id: string
}
}
export interface FinishRequestAction extends Action {
type: 'REQUESTS_FINISH_REQUEST'
payload: {
id: string
succeeded: boolean
}
}
export type RequestsActions = StartRequestAction | FinishRequestAction
const startRequest = (id: string): StartRequestAction => ({
type: 'REQUESTS_START_REQUEST',
payload: {
id,
},
})
const finishRequest = (id: string, succeeded: boolean): FinishRequestAction => ({
type: 'REQUESTS_FINISH_REQUEST',
payload: {
id,
succeeded,
},
})
export {
startRequest,
finishRequest,
}