mattermost-mobile/service/selectors/entities/posts.js
Harrison Healey c28d64c8da #96/#112/PLT-5370/PLT-5372 Styling posts and channel view (#213)
* Updated post rendering in center channel to include dates, display names, themeing, profile pictures, and threads

* Added status to ProfilePicture component

* Changed MemberListRow to use a ProfilePicture

* Removed unused prop

* Fixed incorrect copyright year on new file

* Removed unnecessary ref
2017-02-02 13:53:42 -03:00

20 lines
550 B
JavaScript

// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {createSelector} from 'reselect';
export function getAllPosts(state) {
return state.entities.posts.posts;
}
function getPostIdsInCurrentChannel(state) {
return state.entities.posts.postsByChannel[state.entities.channels.currentId] || [];
}
export const getPostsInCurrentChannel = createSelector(
getAllPosts,
getPostIdsInCurrentChannel,
(posts, postIds) => {
return postIds.map((id) => posts[id]);
}
);