aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/apps/inventoryApp/src/handlers/panelHandler.ts
blob: 7912d0ea54b11902bfe93a2351854b3c21fc59eb (plain)
1
2
3
4
5
6
7
8
9
10
11
import { IActionHandler } from '../../../../framework/src/flux/action';

import { SetPanelAction } from '../actions/panelActions';
import { PanelId } from '../models/panelId';

export const currentOpenPanelHandler: IActionHandler<PanelId> = (state = null, action) => {
  if (action instanceof SetPanelAction) {
    state = action.panelId;
  }
  return state;
};