Started boilerplate getSessionConversationInfo

pull/1102/head
Vincent 5 years ago
parent a90cae4ac4
commit c365481aee

@ -39,7 +39,7 @@ export class SessionConversation extends React.Component<any, any> {
// } // }
render() { render() {
// console.log(`[vince]`, this.props); console.log(`[vince]`, this.props);
// // const headerProps = this.props.getHeaderProps; // // const headerProps = this.props.getHeaderProps;
// const { conversationKey } = this.props; // const { conversationKey } = this.props;
@ -195,4 +195,4 @@ export class SessionConversation extends React.Component<any, any> {
// public scrollToBottom() { // public scrollToBottom() {
// } // }
// } }

@ -22,8 +22,7 @@ export const getConversationLookup = createSelector(
} }
); );
export const getSelectedConversation = createSelector( export const getSelectedConversation = createSelector(getConversations,
getConversations,
(state: ConversationsStateType): string | undefined => { (state: ConversationsStateType): string | undefined => {
return state.selectedConversation; return state.selectedConversation;
} }

@ -3,12 +3,16 @@ import { mapDispatchToProps } from '../actions';
import { SessionConversation } from '../../components/session/SessionConversation'; import { SessionConversation } from '../../components/session/SessionConversation';
import { StateType } from '../reducer'; import { StateType } from '../reducer';
import { getSessionConversationInfo } from '../selectors/conversations'; import { getSessionConversationInfo, getSelectedConversation } from '../selectors/conversations';
const mapStateToProps = (state: StateType) => { const mapStateToProps = (state: StateType) => {
const lists = getSessionConversationList(state); const lists = getSessionConversationInfo(state);
const selectedConversation = getSelectedConversation(state);
return lists;
return {
...lists,
selectedConversation,
}
}; };
const smart = connect(mapStateToProps, mapDispatchToProps); const smart = connect(mapStateToProps, mapDispatchToProps);

Loading…
Cancel
Save