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

Devtools: Use different action when recomputing state history #1255

Closed
brandonroberts opened this issue Aug 16, 2018 · 2 comments
Closed

Devtools: Use different action when recomputing state history #1255

brandonroberts opened this issue Aug 16, 2018 · 2 comments

Comments

@brandonroberts
Copy link
Member

Describe any alternatives/workarounds you're currently using

Other information:

If accepted, I would be willing to submit a PR for this feature

[ ] Yes (Assistance is provided if you need help submitting a pull request)
[ ] No

Currently, when store-devtools is enabled and feature stores are loaded, it uses the same @ngrx/store/update-reducers action to recompute the state history. This is confusing because users think its changing state, when its just a pass-through action to update the reducer map. Update this to a new action that is more descriptive and accurate of what's happening.

@tja4472
Copy link
Contributor

tja4472 commented Sep 23, 2018

https://github.com/ngrx/platform/blob/d2992c9ae0424405be838d5fe971092849d48326/modules/store-devtools/src/reducer.ts#L501,L505

          // Recompute state history with latest reducer and update action
          computedStates = computedStates.map(cmp => ({
            ...cmp,
            state: reducer(cmp.state, liftedAction),
          }));

Is this a case of replacing liftedAction with RECOMPUTE_STATE_ACTION?

const RECOMPUTE_STATE = '@ngrx/AAAAA/recomput-state' as '@ngrx/AAAAA/recomput-state';
const RECOMPUTE_STATE_ACTION = { type: RECOMPUTE_STATE };

@brandonroberts
Copy link
Member Author

@tja4472 yes, that's correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants