Creates a patch diff between the initial and live state. Basically it detects what the user changed in the state.
getStateDiff: <T,>