Skip to content

Commit

Permalink
Make commit button work
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandrHoroshih committed Jul 27, 2023
1 parent 52b2dbc commit 8816b51
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,21 @@ export function attachReduxDevTools({
},
});

// handling of buttons
const unsub = controller.subscribe((message: any) => {
if (message?.payload?.type === "COMMIT") {
/**
* Committing the state to the devtools,
* so it is possible to cleanup all the logs
*/
controller.init(state);
return;
}
});

return () => {
uninspect();
unsub();
};
}

Expand Down

0 comments on commit 8816b51

Please sign in to comment.