summaryrefslogtreecommitdiff
path: root/buildscripts/libdeps/graph_visualizer_web_stack/src/redux/nodeInfo.js
blob: 381c66f4bc7f9b3d1695137217171133bba3deba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { initialState } from "./store";

export const nodeInfo = (state = initialState, action) => {
  switch (action.type) {
    case "setNodeInfos":
      return action.payload;
    case "addNodeInfo":
      return [...state, action.payload];

    default:
      return state;
  }
};

export const setNodeInfos = (nodeInfos) => ({
  type: "setNodeInfos",
  payload: nodeInfos,
});