Grégoire Delattre bcadc48d5a Launch prettier with the --fix option
They've changed their default settings, this changes a lot of stuff in
our code base.
2020-04-01 17:55:34 +02:00

38 lines
718 B
JavaScript

import { Map } from "immutable";
const defaultState = Map({
show: false,
message: "",
type: "",
});
const handlers = {
ADD_ALERT_ERROR: (state, action) =>
state.merge(
Map({
message: action.payload.message,
show: true,
type: "error",
})
),
ADD_ALERT_OK: (state, action) =>
state.merge(
Map({
message: action.payload.message,
show: true,
type: "success",
})
),
DISMISS_ALERT: (state) =>
state.merge(
Map({
message: "",
show: false,
type: "",
})
),
};
export default (state = defaultState, action) =>
handlers[action.type] ? handlers[action.type](state, action) : state;