import { createReducer, on } from '@ngrx/store';
import { initialState } from './state';
import { windowResized } from './actions';

export const reducer = createReducer(
  initialState,
  on(windowResized, (state, action) => {
    return {
      ...state,
      windowSize: {
        width: action.width,
        height: action.height
      }
    };
  })
);
