Last active
September 26, 2020 22:13
-
-
Save lushiyun/0ad7ddccb00ebe79db3b7a6b145a3230 to your computer and use it in GitHub Desktop.
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
// src/features/messages/messagesSlice.js | |
... | |
export const { selectAll: selectAllMessages } = messagesAdapter.getSelectors( | |
(state) => state.messages | |
) | |
export const selectMessagesByTeam = createSelector( | |
[selectAllMessages, (state, teamId) => teamId], | |
(messages, teamId) => messages.filter((message) => message.teamId === teamId) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment