redo() {
        if (this.index + 1 === this.history.length) {
            return undefined;
        }
        this.index += 1;
        this.isWorkingOnCommit = false;
        let result = this.history[this.index];
        this._changes.send(result);
        this._latestActiveCommit.set(result);
        return result;
    }
Marks the next state as the current state and returns it (or does nothing if there is no next state).
@returns {undefined|*} The new current state, or undefined if there's nothing to redo.