UNPKG

gittoken-reducers

Version:

Redux Reducers for GitToken Application State Management

34 lines (31 loc) 613 B
const DEFAULT_STATE = { metaMaskInstalled: false, metaMaskLocked: true, address: '', profile: {}, email: '', menu: [{ key: 'register', title: 'Register Organization', link: '/register' }, { key: 'contributions', title: 'Contribution Activity', link: '/contributions' }], organizations: [] } const Account = function(state=DEFAULT_STATE, action) { const { type, id, value } = action switch(type) { case 'SET_ACCOUNT_DETAILS': return { ...state, [id]: value } break; default: return state; } } export default Account