18 lines
522 B
TypeScript
Raw Normal View History

2018-03-29 15:04:04 +02:00
import { AppState } from 'reducers';
import { getWindowSize } from './fields';
interface ICurrentWindowSize {
raw: string;
value: number | null;
}
const isValidCurrentWindowSize = (state: AppState) => {
const currentWindowSize = getWindowSize(state);
return currentWindowSize && currentWindowSize.value && currentWindowSize.value > 0;
};
const getCurrentWindowSize = (state: AppState): ICurrentWindowSize => getWindowSize(state);
export { getCurrentWindowSize, ICurrentWindowSize, isValidCurrentWindowSize };