Skip to content

Commit

Permalink
Print state properties that have changed in unnamed actions and setState
Browse files Browse the repository at this point in the history
  • Loading branch information
lkmill committed Apr 7, 2020
1 parent f53452e commit 4361a83
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion devtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ module.exports = function unistoreDevTools(store) {
});
store.devtools.init(store.getState());
store.subscribe(function (state, action, update) {
var actionName = action ? action.type || action.name || 'Unnamed' : 'setState';
var actionName = action
? action.type ||
action.name ||
'N/A (' + (Object.keys(update).join(', ') || 'none') + ')'
: 'setState (' + (Object.keys(update).join(', ') || 'none') + ')';

if (!ignoreState) {
store.devtools.send({ type: actionName, update: update }, state);
Expand Down

0 comments on commit 4361a83

Please sign in to comment.