-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement performance flags structure
Performance flags (reduxState.controls.performanceFlags) represent flags for which we enable/disable certain functionality in Auspice. These flags shouldn't be depended on, i.e. Auspice should work just fine without them (but may be a little slow).
- Loading branch information
1 parent
f046672
commit 1542bc6
Showing
4 changed files
with
32 additions
and
2 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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import * as types from "../actions/types"; | ||
|
||
/** | ||
* Performance flags (reduxState.controls.performanceFlags) represent flags | ||
* for which we enable/disable certain functionality in Auspice. These flags | ||
* shouldn't be depended on, i.e. Auspice should work just fine without them | ||
* (but may be a little slow). | ||
*/ | ||
|
||
|
||
export const performanceFlags = (_store) => (next) => (action) => { | ||
let modifiedAction; | ||
switch (action.type) { | ||
case types.URL_QUERY_CHANGE_WITH_COMPUTED_STATE: /* fallthrough */ | ||
case types.CLEAN_START: { | ||
modifiedAction = {...action}; | ||
modifiedAction.controls.performanceFlags = calculate() | ||
} | ||
} | ||
return next(modifiedAction || action); // send action to other middleware / reducers | ||
}; | ||
|
||
function calculate() { | ||
const flags = new Map(); | ||
return flags; | ||
} |
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