-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: restore old behavior to reset state when dispatching undefined
ref #3250
- Loading branch information
1 parent
0cb2a02
commit 0b4fe33
Showing
46 changed files
with
130 additions
and
125 deletions.
There are no files selected for viewing
3 changes: 2 additions & 1 deletion
3
...p/codeCharta/state/store/appSettings/amountOfEdgePreviews/amountOfEdgePreviews.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { setAmountOfEdgePreviews } from "./amountOfEdgePreviews.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultAmountOfEdgesPreviews = 1 | ||
export const amountOfEdgePreviews = createReducer( | ||
defaultAmountOfEdgesPreviews, | ||
on(setAmountOfEdgePreviews, (_state, action) => action.value) | ||
on(setAmountOfEdgePreviews, setState(defaultAmountOfEdgesPreviews)) | ||
) |
6 changes: 2 additions & 4 deletions
6
...ion/app/codeCharta/state/store/appSettings/amountOfTopLabels/amountOfTopLabels.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { setAmountOfTopLabels } from "./amountOfTopLabels.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultAmountOfTopLabels = 1 | ||
export const amountOfTopLabels = createReducer( | ||
defaultAmountOfTopLabels, | ||
on(setAmountOfTopLabels, (_state, action) => action.value) | ||
) | ||
export const amountOfTopLabels = createReducer(defaultAmountOfTopLabels, on(setAmountOfTopLabels, setState(defaultAmountOfTopLabels))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 3 additions & 5 deletions
8
visualization/app/codeCharta/state/store/appSettings/colorLabels/colorLabels.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { setColorLabels } from "./colorLabels.actions" | ||
import { ColorLabelOptions } from "../../../../codeCharta.model" | ||
import { mergeState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultColorLabels: ColorLabelOptions = { positive: false, negative: false, neutral: false } | ||
export const colorLabels = createReducer( | ||
defaultColorLabels, | ||
on(setColorLabels, (state, action) => ({ ...state, ...action.value })) | ||
) | ||
export const defaultColorLabelOptions: ColorLabelOptions = { positive: false, negative: false, neutral: false } | ||
export const colorLabels = createReducer(defaultColorLabelOptions, on(setColorLabels, mergeState(defaultColorLabelOptions))) |
6 changes: 2 additions & 4 deletions
6
visualization/app/codeCharta/state/store/appSettings/edgeHeight/edgeHeight.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { setEdgeHeight } from "./edgeHeight.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultEdgeHeight = 4 | ||
export const edgeHeight = createReducer( | ||
defaultEdgeHeight, | ||
on(setEdgeHeight, (_state, action) => action.value) | ||
) | ||
export const edgeHeight = createReducer(defaultEdgeHeight, on(setEdgeHeight, setState(defaultEdgeHeight))) |
3 changes: 2 additions & 1 deletion
3
...odeCharta/state/store/appSettings/enableClipboard/screenshotToClipboardEnabled.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { setScreenshotToClipboardEnabled } from "./screenshotToClipboardEnabled.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultScreenshotToClipboardEnabled = false | ||
export const screenshotToClipboardEnabled = createReducer( | ||
defaultScreenshotToClipboardEnabled, | ||
on(setScreenshotToClipboardEnabled, (_state, action) => action.value) | ||
on(setScreenshotToClipboardEnabled, setState(defaultScreenshotToClipboardEnabled)) | ||
) |
3 changes: 2 additions & 1 deletion
3
...state/store/appSettings/enableExperimentalFeatures/experimentalFeaturesEnabled.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { setExperimentalFeaturesEnabled } from "./experimentalFeaturesEnabled.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultExperimentalFeaturesEnabled = false | ||
export const experimentalFeaturesEnabled = createReducer( | ||
defaultExperimentalFeaturesEnabled, | ||
on(setExperimentalFeaturesEnabled, (_state, action) => action.value) | ||
on(setExperimentalFeaturesEnabled, setState(defaultExperimentalFeaturesEnabled)) | ||
) |
6 changes: 2 additions & 4 deletions
6
...ion/app/codeCharta/state/store/appSettings/enableFloorLabels/enableFloorLabels.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { setEnableFloorLabels } from "./enableFloorLabels.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultEnableFloorLabels = true | ||
export const enableFloorLabels = createReducer( | ||
defaultEnableFloorLabels, | ||
on(setEnableFloorLabels, (_state, action) => action.value) | ||
) | ||
export const enableFloorLabels = createReducer(defaultEnableFloorLabels, on(setEnableFloorLabels, setState(defaultEnableFloorLabels))) |
6 changes: 2 additions & 4 deletions
6
...ion/app/codeCharta/state/store/appSettings/hideFlatBuildings/hideFlatBuildings.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { setHideFlatBuildings } from "./hideFlatBuildings.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultHideFlatBuildings = false | ||
export const hideFlatBuildings = createReducer( | ||
defaultHideFlatBuildings, | ||
on(setHideFlatBuildings, (_state, action) => action.value) | ||
) | ||
export const hideFlatBuildings = createReducer(defaultHideFlatBuildings, on(setHideFlatBuildings, setState(defaultHideFlatBuildings))) |
6 changes: 2 additions & 4 deletions
6
visualization/app/codeCharta/state/store/appSettings/invertArea/invertArea.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { setInvertArea } from "./invertArea.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultInvertArea = false | ||
export const invertArea = createReducer( | ||
defaultInvertArea, | ||
on(setInvertArea, (_state, action) => action.value) | ||
) | ||
export const invertArea = createReducer(defaultInvertArea, on(setInvertArea, setState(defaultInvertArea))) |
6 changes: 2 additions & 4 deletions
6
visualization/app/codeCharta/state/store/appSettings/invertHeight/invertHeight.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { setInvertHeight } from "./invertHeight.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultInvertHeight = false | ||
export const invertHeight = createReducer( | ||
defaultInvertHeight, | ||
on(setInvertHeight, (_state, action) => action.value) | ||
) | ||
export const invertHeight = createReducer(defaultInvertHeight, on(setInvertHeight, setState(defaultInvertHeight))) |
6 changes: 2 additions & 4 deletions
6
visualization/app/codeCharta/state/store/appSettings/isLoadingFile/isLoadingFile.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { setIsLoadingFile } from "./isLoadingFile.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultIsLoadingFile = true | ||
export const isLoadingFile = createReducer( | ||
defaultIsLoadingFile, | ||
on(setIsLoadingFile, (_state, action) => action.value) | ||
) | ||
export const isLoadingFile = createReducer(defaultIsLoadingFile, on(setIsLoadingFile, setState(defaultIsLoadingFile))) |
6 changes: 2 additions & 4 deletions
6
visualization/app/codeCharta/state/store/appSettings/isLoadingMap/isLoadingMap.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { setState } from "../../util/setState.reducer.factory" | ||
import { setIsLoadingMap } from "./isLoadingMap.actions" | ||
import { createReducer, on } from "@ngrx/store" | ||
|
||
export const defaultIsLoadingMap = true | ||
export const isLoadingMap = createReducer( | ||
defaultIsLoadingMap, | ||
on(setIsLoadingMap, (_state, action) => action.value) | ||
) | ||
export const isLoadingMap = createReducer(defaultIsLoadingMap, on(setIsLoadingMap, setState(defaultIsLoadingMap))) |
6 changes: 2 additions & 4 deletions
6
...n/app/codeCharta/state/store/appSettings/isPresentationMode/isPresentationMode.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { setPresentationMode } from "./isPresentationMode.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultIsPresentationMode = false | ||
export const isPresentationMode = createReducer( | ||
defaultIsPresentationMode, | ||
on(setPresentationMode, (_state, action) => action.value) | ||
) | ||
export const isPresentationMode = createReducer(defaultIsPresentationMode, on(setPresentationMode, setState(defaultIsPresentationMode))) |
6 changes: 2 additions & 4 deletions
6
...ion/app/codeCharta/state/store/appSettings/isWhiteBackground/isWhiteBackground.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { setIsWhiteBackground } from "./isWhiteBackground.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultIsWhiteBackground = false | ||
export const isWhiteBackground = createReducer( | ||
defaultIsWhiteBackground, | ||
on(setIsWhiteBackground, (_state, action) => action.value) | ||
) | ||
export const isWhiteBackground = createReducer(defaultIsWhiteBackground, on(setIsWhiteBackground, setState(defaultIsWhiteBackground))) |
6 changes: 2 additions & 4 deletions
6
...ization/app/codeCharta/state/store/appSettings/layoutAlgorithm/layoutAlgorithm.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { LayoutAlgorithm } from "../../../../codeCharta.model" | ||
import { setLayoutAlgorithm } from "./layoutAlgorithm.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultLayoutAlgorithm = LayoutAlgorithm.SquarifiedTreeMap | ||
export const layoutAlgorithm = createReducer( | ||
defaultLayoutAlgorithm, | ||
on(setLayoutAlgorithm, (_state, action) => action.value) | ||
) | ||
export const layoutAlgorithm = createReducer(defaultLayoutAlgorithm, on(setLayoutAlgorithm, setState(defaultLayoutAlgorithm))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
...ization/app/codeCharta/state/store/appSettings/maxTreeMapFiles/maxTreeMapFiles.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { setMaxTreeMapFiles } from "./maxTreeMapFiles.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultMaxTreeMapFiles = 100 | ||
export const maxTreeMapFiles = createReducer( | ||
defaultMaxTreeMapFiles, | ||
on(setMaxTreeMapFiles, (_state, action) => action.value) | ||
) | ||
export const maxTreeMapFiles = createReducer(defaultMaxTreeMapFiles, on(setMaxTreeMapFiles, setState(defaultMaxTreeMapFiles))) |
3 changes: 2 additions & 1 deletion
3
...te/store/appSettings/resetCameraIfNewFileIsLoaded/resetCameraIfNewFileIsLoaded.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { setResetCameraIfNewFileIsLoaded } from "./resetCameraIfNewFileIsLoaded.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultResetCameraIfNewFileIsLoaded = true | ||
export const resetCameraIfNewFileIsLoaded = createReducer( | ||
defaultResetCameraIfNewFileIsLoaded, | ||
on(setResetCameraIfNewFileIsLoaded, (_state, action) => action.value) | ||
on(setResetCameraIfNewFileIsLoaded, setState(defaultResetCameraIfNewFileIsLoaded)) | ||
) |
6 changes: 2 additions & 4 deletions
6
visualization/app/codeCharta/state/store/appSettings/scaling/scaling.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { setScaling } from "./scaling.actions" | ||
import { Scaling } from "../../../../codeCharta.model" | ||
import { mergeState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultScaling: Scaling = { x: 1, y: 1, z: 1 } | ||
export const scaling = createReducer( | ||
defaultScaling, | ||
on(setScaling, (state, action) => ({ ...state, ...action.value })) | ||
) | ||
export const scaling = createReducer(defaultScaling, on(setScaling, mergeState(defaultScaling))) |
6 changes: 2 additions & 4 deletions
6
visualization/app/codeCharta/state/store/appSettings/sharpnessMode/sharpnessMode.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { SharpnessMode } from "../../../../codeCharta.model" | ||
import { setSharpnessMode } from "./sharpnessMode.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultSharpnessMode = SharpnessMode.Standard | ||
export const sharpnessMode = createReducer( | ||
defaultSharpnessMode, | ||
on(setSharpnessMode, (_state, action) => action.value) | ||
) | ||
export const sharpnessMode = createReducer(defaultSharpnessMode, on(setSharpnessMode, setState(defaultSharpnessMode))) |
3 changes: 2 additions & 1 deletion
3
...arta/state/store/appSettings/showMetricLabelNameValue/showMetricLabelNameValue.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { setShowMetricLabelNameValue } from "./showMetricLabelNameValue.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultShowMetricLabelNameValue = false | ||
export const showMetricLabelNameValue = createReducer( | ||
defaultShowMetricLabelNameValue, | ||
on(setShowMetricLabelNameValue, (_state, action) => action.value) | ||
on(setShowMetricLabelNameValue, setState(defaultShowMetricLabelNameValue)) | ||
) |
3 changes: 2 additions & 1 deletion
3
...Charta/state/store/appSettings/showMetricLabelNodeName/showMetricLabelNodeName.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { setShowMetricLabelNodeName } from "./showMetricLabelNodeName.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultShowMetricLabelNodeName = true | ||
export const showMetricLabelNodeName = createReducer( | ||
defaultShowMetricLabelNodeName, | ||
on(setShowMetricLabelNodeName, (_state, action) => action.value) | ||
on(setShowMetricLabelNodeName, setState(defaultShowMetricLabelNodeName)) | ||
) |
3 changes: 2 additions & 1 deletion
3
.../state/store/appSettings/showOnlyBuildingsWithEdges/showOnlyBuildingsWithEdges.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { setShowOnlyBuildingsWithEdges } from "./showOnlyBuildingsWithEdges.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultShowOnlyBuildingsWithEdges = false | ||
export const showOnlyBuildingsWithEdges = createReducer( | ||
defaultShowOnlyBuildingsWithEdges, | ||
on(setShowOnlyBuildingsWithEdges, (_state, action) => action.value) | ||
on(setShowOnlyBuildingsWithEdges, setState(defaultShowOnlyBuildingsWithEdges)) | ||
) |
3 changes: 2 additions & 1 deletion
3
...codeCharta/state/store/appSettings/sortingOrderAscending/sortingOrderAscending.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { setSortingOrderAscending, toggleSortingOrderAscending } from "./sortingOrderAscending.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultSortingOrderAscending = true | ||
export const sortingOrderAscending = createReducer( | ||
defaultSortingOrderAscending, | ||
on(setSortingOrderAscending, (_state, action) => action.value), | ||
on(setSortingOrderAscending, setState(defaultSortingOrderAscending)), | ||
on(toggleSortingOrderAscending, state => !state) | ||
) |
6 changes: 2 additions & 4 deletions
6
visualization/app/codeCharta/state/store/appStatus/hoveredNodeId/hoveredNodeId.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { CcState } from "../../../../codeCharta.model" | ||
import { setHoveredNodeId } from "./hoveredNodeId.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultHoveredNodeId: CcState["appStatus"]["hoveredNodeId"] = null | ||
export const hoveredNodeId = createReducer( | ||
defaultHoveredNodeId, | ||
on(setHoveredNodeId, (_state, action) => action.value) | ||
) | ||
export const hoveredNodeId = createReducer(defaultHoveredNodeId, on(setHoveredNodeId, setState(defaultHoveredNodeId))) |
6 changes: 2 additions & 4 deletions
6
...ion/app/codeCharta/state/store/appStatus/selectedBuildingId/selectedBuildingId.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { CcState } from "../../../../codeCharta.model" | ||
import { setSelectedBuildingId } from "./selectedBuildingId.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultSelectedBuildingId: CcState["appStatus"]["selectedBuildingId"] = null | ||
export const selectedBuildingId = createReducer( | ||
defaultSelectedBuildingId, | ||
on(setSelectedBuildingId, (_state, action) => action.value) | ||
) | ||
export const selectedBuildingId = createReducer(defaultSelectedBuildingId, on(setSelectedBuildingId, setState(defaultSelectedBuildingId))) |
6 changes: 2 additions & 4 deletions
6
visualization/app/codeCharta/state/store/dynamicSettings/areaMetric/areaMetric.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { setAreaMetric } from "./areaMetric.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultAreaMetric: null | string = null | ||
export const areaMetric = createReducer( | ||
defaultAreaMetric, | ||
on(setAreaMetric, (_state, action) => action.value) | ||
) | ||
export const areaMetric = createReducer(defaultAreaMetric, on(setAreaMetric, setState(defaultAreaMetric))) |
6 changes: 2 additions & 4 deletions
6
visualization/app/codeCharta/state/store/dynamicSettings/colorMetric/colorMetric.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { setColorMetric } from "./colorMetric.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultColorMetric: null | string = null | ||
export const colorMetric = createReducer( | ||
defaultColorMetric, | ||
on(setColorMetric, (_state, action) => action.value) | ||
) | ||
export const colorMetric = createReducer(defaultColorMetric, on(setColorMetric, setState(defaultColorMetric))) |
6 changes: 2 additions & 4 deletions
6
visualization/app/codeCharta/state/store/dynamicSettings/colorMode/colorMode.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { ColorMode } from "../../../../codeCharta.model" | ||
import { setColorMode } from "./colorMode.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultColorMode = ColorMode.weightedGradient | ||
export const colorMode = createReducer( | ||
defaultColorMode, | ||
on(setColorMode, (_state, action) => action.value) | ||
) | ||
export const colorMode = createReducer(defaultColorMode, on(setColorMode, setState(defaultColorMode))) |
6 changes: 2 additions & 4 deletions
6
visualization/app/codeCharta/state/store/dynamicSettings/colorRange/colorRange.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { setColorRange } from "./colorRange.actions" | ||
import { ColorRange } from "../../../../codeCharta.model" | ||
import { mergeState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultColorRange: ColorRange = { from: 0, to: 0 } | ||
export const colorRange = createReducer( | ||
defaultColorRange, | ||
on(setColorRange, (state, action) => ({ ...state, ...action.value })) | ||
) | ||
export const colorRange = createReducer(defaultColorRange, on(setColorRange, mergeState(defaultColorRange))) |
6 changes: 2 additions & 4 deletions
6
...p/codeCharta/state/store/dynamicSettings/distributionMetric/distributionMetric.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { setDistributionMetric } from "./distributionMetric.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultDistributionMetric: null | string = null | ||
export const distributionMetric = createReducer( | ||
defaultDistributionMetric, | ||
on(setDistributionMetric, (_state, action) => action.value) | ||
) | ||
export const distributionMetric = createReducer(defaultDistributionMetric, on(setDistributionMetric, setState(defaultDistributionMetric))) |
6 changes: 2 additions & 4 deletions
6
visualization/app/codeCharta/state/store/dynamicSettings/edgeMetric/edgeMetric.reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { createReducer, on } from "@ngrx/store" | ||
import { setEdgeMetric } from "./edgeMetric.actions" | ||
import { setState } from "../../util/setState.reducer.factory" | ||
|
||
export const defaultEdgeMetric: null | string = null | ||
export const edgeMetric = createReducer( | ||
defaultEdgeMetric, | ||
on(setEdgeMetric, (_state, action) => action.value) | ||
) | ||
export const edgeMetric = createReducer(defaultEdgeMetric, on(setEdgeMetric, setState(defaultEdgeMetric))) |
Oops, something went wrong.