mattermost-mobile/service/selectors/entities/teams.js
Harrison Healey 4ecd3758e7 Render posts for the current channel (#153)
* Added selectChannel action

* Fixed selected team not being cleared on logout

* Fixed posts and postsByChannel not being initialized correctly

* Added basic post rendering

* Renamed selectors files to be plural

* Removed empty file

* Fixed unit tests after merge

* Removing unnecessary code
2016-12-23 10:55:33 -03:00

21 lines
472 B
JavaScript

// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {createSelector} from 'reselect';
export function getCurrentTeamId(state) {
return state.entities.teams.currentId;
}
export function getTeams(state) {
return state.entities.teams.teams;
}
export const getCurrentTeam = createSelector(
getTeams,
getCurrentTeamId,
(teams, currentTeamId) => {
return teams[currentTeamId];
}
);