Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] Added new options parameter to override single action reducer default behavior #2217

Merged
merged 1 commit into from May 7, 2023

Conversation

igorDykhta
Copy link
Collaborator

@igorDykhta igorDykhta commented May 2, 2023

This PR implements the ability to override reducer single action default behavior through plugin.

Developers can override default behavior by doing the following:

const customReducer = keplerGlReducer
    .plugin(
      {
        [ActionTypes.LAYER_TYPE_CHANGE]: (state, action) => {
          return {
            ...state,
            visState: {
              ...layerTypeChangeUpdater(state.visState, action),
              // do the default behavior and update layerOrder to empty
              layerOrder: []
            }
          };
        }
      },
      {override: {[ActionTypes.LAYER_TYPE_CHANGE]: true}}
    );

…default behavior

Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>
@igorDykhta igorDykhta merged commit e1e165e into master May 7, 2023
4 of 9 checks passed
@delete-merged-branch delete-merged-branch bot deleted the igr/ups-add-new-option-reducer branch May 7, 2023 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants