Created
November 11, 2020 23:48
-
-
Save blogcacanid/d5ce97679826f0b202336d1a922d629f to your computer and use it in GitHub Desktop.
message.js Authentication JWT React JS Lumen 7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { SET_MESSAGE, CLEAR_MESSAGE } from "../actions/types"; | |
const initialState = {}; | |
export default function (state = initialState, action) { | |
const { type, payload } = action; | |
switch (type) { | |
case SET_MESSAGE: | |
return { message: payload }; | |
case CLEAR_MESSAGE: | |
return { message: "" }; | |
default: | |
return state; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment