import { Action, } from '@ngrx/store'; import { DimensionsInterface, } from './../../models/index'; import { ScreenSizeStateInterface, } from './screen-size-state.interface'; export interface InitScreenSizeReducerAction extends Action { state: ScreenSizeStateInterface; } export const INIT_SCREEN_SIZE_REDUCER = 'INIT_SCREEN_SIZE_REDUCER'; export function initScreenSizeReducer( state: ScreenSizeStateInterface, ): InitScreenSizeReducerAction { return { state, type: INIT_SCREEN_SIZE_REDUCER, }; } export interface SetScreenSizeAction extends Action { screenSize: DimensionsInterface; } export const SET_SCREEN_SIZE = 'SET_SCREEN_SIZE'; export function setScreenSize( screenSize: DimensionsInterface, ): SetScreenSizeAction { return { screenSize, type: SET_SCREEN_SIZE, }; } export interface SetCutoffWidthAction extends Action { cutoffWidth: number; } export const SET_TABLET_CUTOFF_WIDTH = 'SET_TABLET_CUTOFF_WIDTH'; export function setTabletCutoffWidth( cutoffWidth: number, ): SetCutoffWidthAction { return { cutoffWidth, type: SET_TABLET_CUTOFF_WIDTH, }; } export const SET_DESKTOP_CUTOFF_WIDTH = 'SET_DESKTOP_CUTOFF_WIDTH'; export function setDesktopCutoffWidth( cutoffWidth: number, ): SetCutoffWidthAction { return { cutoffWidth, type: SET_DESKTOP_CUTOFF_WIDTH, }; }