Add new "replay" button
mike-thompson-day8 opened this issue · 2 comments
mike-thompson-day8 commented
Add a new "replay" button which performs two steps:
- resets
app-db
to the value it had prior to the current event, and then, once all consequent computation is complete (subscriptions have run and views have updated - dominoes 4,5,6), - re-dispatches the current event.
So it provides for an action replay of the "current event". The one to which the user has navigated.
Notes:
- Any trace arising out of Step 1 is ignored (any change to
app-db
will trigger subscriptions and views) - All trace arising out of Step 2 forms a normal epoch which is appended to the end of the existing epoch list, AND the user is transported to view this new epoch. So they immediately see the results for this new epoch.
- Button should be visible/available in all tabs.
Will be useful:
- in the Timings tab to see if the numbers are stable across multiple runs.
- whenever we hotload (via figwheel) a fixed/altered event handler, subscription handler or view, and we want to test if our change works. Figwheel+replayis lovely, simple debugging move.
Open Questions:
- should this button be visible if the user has "paused" collection of events? Probably not.
- should it be muted as depicted? Or strong blue?
mike-thompson-day8 commented
I've written up some docs:
https://github.com/Day8/re-frame-trace/blob/master/docs/HyperlinkedInformation/ReplayButton.md
Gregg8 commented
Replay button UI added (and info button hooked up to Mike's document). Just needs connecting to the functionality.