Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@blogcacanid
Created November 11, 2020 23:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blogcacanid/d5ce97679826f0b202336d1a922d629f to your computer and use it in GitHub Desktop.
Save blogcacanid/d5ce97679826f0b202336d1a922d629f to your computer and use it in GitHub Desktop.
message.js Authentication JWT React JS Lumen 7
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