yapi/client/reducer/Interface/InterfaceReducer.js
2017-07-14 11:27:34 +08:00

33 lines
624 B
JavaScript

import {
FETCH_INTERFACE_DATA,
LIST_INTERFACE_CLICK,
PROJECT_MEMBER_INTERFACE
} from '../../constants/action-types.js'
const initialState = {
interfaceData: null,
modalVisible: false
}
export default (state = initialState, action) => {
switch (action.type) {
case FETCH_INTERFACE_DATA:
return {
...state,
interfaceData: action.payload
}
case LIST_INTERFACE_CLICK:
return {
...state,
modalVisible: true
}
case PROJECT_MEMBER_INTERFACE:
return {
...state,
modalVisible: false
}
default:
return state
}
}