Improve reliance on selector caching

This commit is contained in:
Jordan Eldredge 2019-05-02 07:23:41 -07:00
parent 756854eaec
commit c75214dcd7
2 changed files with 3 additions and 2 deletions

View file

@ -8,14 +8,14 @@ import { toggleWindow } from "../../actionCreators";
const PlaylistToggleButton = props => (
<div
id="playlist-button"
className={classnames({ selected: props.getWindowOpen("playlist") })}
className={classnames({ selected: props.selected })}
onClick={props.handleClick}
title="Toggle Playlist Editor"
/>
);
const mapStateToProps = state => ({
getWindowOpen: getWindowOpen(state),
selected: getWindowOpen(state)("playlist"),
});
const mapDispatchToProps = {

View file

@ -461,6 +461,7 @@ export function getLlamaMode(state: AppState) {
return state.display.llama;
}
// TODO: This is poorly memoized. It invalidates when a window moves.
export const getWindowSizes = createSelector(
getGenWindows,
getDoubled,