const CONDENSED_WIDTH = 750 ; export interface State { width : number ; isEnlarged : boolean ; } export interface Getters { isCondensed : boolean ; } export const windowStore = { state : { width : window . outerWidth , isEnlarged : false , } as State , getters : { isCondensed : ( state ) => { return state . width <= CONDENSED_WIDTH ; } , } , mutations : { UPDATE_WINDOW_WIDTH ( state , width ) { state . width = width ; if ( state . width > CONDENSED_WIDTH ) { state . isEnlarged = false ; } } , SET_ENLARGED ( state , isEnlarged ) { state . isEnlarged = isEnlarged ; } , } } ;