Created
June 4, 2021 18:43
-
-
Save michael-mckenna/056baea580d6d7bc0f5013f8dee0bf4d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// gets the channel id of the currently selected channel | |
export const selectCurrentChannelId = createSelector( | |
selectMessagesState, | |
getSelectedChannelId | |
); | |
export const selectMessageEntities = createSelector( | |
selectMessagesState, | |
selectMessageContainerEntities | |
); | |
// Gets messages for the currently selected channel | |
export const selectCurrentChannelMessages = createSelector( | |
selectMessageEntities, | |
selectCurrentChannelId, | |
(messageEntities, channelId) => messageEntities[channelId].messages | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment