ngrx / store-devtools

Developer Tools for @ngrx/store
MIT License
326 stars 38 forks source link

Add support for LOCK_CHANGES actions #69

Closed MrWolfZ closed 1 year ago

MrWolfZ commented 7 years ago

Hi. One feature I really wanted to see in the ngrx devtools is support for locking changes, since it improves the time-travel debugging experience quite a lot.

First of all, please note that this PR is not complete yet. See below for open points.

The code from this PR is copied mostly from the redux-devtools-instrument repo. I just had to made some slight changes. As far as I can see everything works as expected, but I couldn't really use it yet for a project due to the issue below.

Open point

I have not yet found out how to notify the monitor (personally I am using the chrome extension) that the lock state changed. Therefore, currently the monitor will always send the LOCK_CHANGES action with status true making the store locked indefinitely. The monitor UI also doesn't update to reflect the change. I am hoping some of you will be able to help me figuring out how this should be done.

robwormald commented 7 years ago

can you explain the use case behind this? PR seems reasonable, I just don't have any context on what/why you'd want to do this.

MrWolfZ commented 7 years ago

I think this is a reasonable feature because a) the devtools monitor supports this feature (i.e. it has a button for it) and I got confused when a button in the devtools simply didn't do anything in combination with ngrx b) for the app I am working on it is very useful when doing time travel debugging to prevent any new actions being dispatched, not because they mess up the current state (which is frozen), but because they pollute the action list. Also, those additional actions cause the time travel slider to jump and they don't allow me to simply continue with the latest state after I finished debugging c) see the twitter link in the original devtools PR that added this feature for an idea of what this could be used for with some more changes

Please note that I have updated the PR with a fix that makes the change play nicely with the devtools. I realized I had mis-named a property on the lifted state. With this change the PR is ready to be merged if you are willing to do so.

MrWolfZ commented 6 years ago

Any chance of this getting merged?