Skip to content

Instantly share code, notes, and snippets.

@ericelliott
Created August 28, 2016 03:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ericelliott/97ad722d1f65484752ced4cdcc145040 to your computer and use it in GitHub Desktop.
Save ericelliott/97ad722d1f65484752ced4cdcc145040 to your computer and use it in GitHub Desktop.
Chat reducer test factories
const createChat = ({
id = 0,
msg = '',
user = 'Anonymous',
timeStamp = 1472322852680
} = {}) => ({
id, msg, user, timeStamp
});
const createState = ({
userName = 'Anonymous',
chatLog = [],
statusMessage = 'Online',
currentChat = createChat()
} = {}) => ({
userName, chatLog, statusMessage, currentChat
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment