Skip to content

Instantly share code, notes, and snippets.

@ericelliott
Last active December 14, 2016 11:13
Show Gist options
  • Save ericelliott/8a8ad94e53f82b90220a35e4e7515b18 to your computer and use it in GitHub Desktop.
Save ericelliott/8a8ad94e53f82b90220a35e4e7515b18 to your computer and use it in GitHub Desktop.
Chat getViewState() selector
export const getViewState = state => Object.assign({}, state, {
// return a list of users active during this session
recentlyActiveUsers: [...new Set(state.chatLog.map(chat => chat.user))]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment