-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: remove immer from static report
- Loading branch information
1 parent
77750a9
commit 44c1b12
Showing
19 changed files
with
644 additions
and
307 deletions.
There are no files selected for viewing
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,25 +1,16 @@ | ||
import actionNames from '../action-names'; | ||
import {applyStateUpdate} from '../utils/state'; | ||
|
||
export default (state, action) => { | ||
switch (action.type) { | ||
case actionNames.INIT_GUI_REPORT: | ||
case actionNames.INIT_STATIC_REPORT: { | ||
const {apiValues} = action.payload; | ||
|
||
return applyChanges(state, apiValues); | ||
return applyStateUpdate(state, {apiValues}); | ||
} | ||
|
||
default: | ||
return state; | ||
} | ||
}; | ||
|
||
function applyChanges(state, apiValues) { | ||
return { | ||
...state, | ||
apiValues: { | ||
...state.apiValues, | ||
...apiValues | ||
} | ||
}; | ||
} |
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,16 +1,14 @@ | ||
import actionNames from '../action-names'; | ||
import {produce} from 'immer'; | ||
import {set} from 'lodash'; | ||
import {applyStateUpdate} from '../utils/state'; | ||
|
||
export default produce((draft, action) => { | ||
export default ((state, action) => { | ||
switch (action.type) { | ||
case actionNames.UPDATE_BOTTOM_PROGRESS_BAR: { | ||
const {currentRootSuiteId} = action.payload; | ||
|
||
return set(draft, 'progressBar.currentRootSuiteId', currentRootSuiteId); | ||
return applyStateUpdate(state, {progressBar: {currentRootSuiteId}}); | ||
} | ||
|
||
default: | ||
return draft; | ||
return state; | ||
} | ||
}); |
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
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
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
Oops, something went wrong.