Something went wrong on our end
-
Art Lowel authored05626e26
host-window.reducer.ts 506 B
import { HostWindowAction, HostWindowActionTypes } from './host-window.actions';
export interface HostWindowState {
width: number;
height: number;
}
const initialState: HostWindowState = {
width: null,
height: null
};
export function hostWindowReducer(state = initialState, action: HostWindowAction): HostWindowState {
switch (action.type) {
case HostWindowActionTypes.RESIZE: {
return Object.assign({}, state, action.payload);
}
default: {
return state;
}
}
}