Open SomethingSexy opened 8 years ago
export function applications(state = [], action) { switch (action.type) { case CREATING_APPLICATION: // loop through each applications return state.map(application => { if (application.id !== action.id) { return application; } return { ...application, saving: true }; }); case CREATED_APPLICATION: // loop through each applications return state.map(application => { if (application.id !== action.id) { return application; } return { ...application, saving: false }; }); default: return state; } }