forked from mattermost/mattermost-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
posts.js
22 lines (19 loc) · 640 Bytes
/
posts.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {createSelector} from 'reselect';
import {getPost} from 'mattermost-redux/selectors/entities/posts';
export const getEditingPost = createSelector(
(state) => {
if (state.views.posts.editingPost && state.views.posts.editingPost.postId) {
return getPost(state, state.views.posts.editingPost.postId);
}
return null;
},
(state) => state.views.posts.editingPost,
(post, editingPost) => {
return {
...editingPost,
post,
};
}
);