const compare = require('state-compare');
let currentState = {
someValue: 30
};
let nextState = {
someValue: 50
};
compare.isDifferent(currentState, nextState); // true
state-compare
can be used for comparing any data and isnt tied to comparing states. Any object or array/arrays of objects can be used.