Returns an array of the last changes made to the data object.
Returns an array of the errors associated with the changeset.
Returns a boolean indicating whether the changeset is dirty (has changes).
Returns a boolean indicating whether the changeset is invalid (has errors).
Returns a boolean indicating whether the changeset is pristine (has no changes).
Returns a boolean indicating whether the changeset is valid (has no errors).
Adds a new error object to the changeset.
The error object to add.
Applies the accumulated changes to the data object.
Registers a callback function to be called whenever a property is set using the set method.
The callback function to register.
A function that can be called to unregister the callback.
Removes the error with the specified key from the changeset.
The key of the error to remove.
Removes all errors from the changeset.
Reverts the changes made to the draft.
Reverts the changes made to the specified property of the changeset object.
The name of the property to revert.
Applies the accumulated changes to the data object and sets the changeset in a pristine state. No rollback is possible after this.
Reverts the previously applied changes to the data object.
Runs the specified validation function on the draft object.
The validation function to run.
A class that represents a changeset for a given data object. It uses Immer to create a draft of the data object and track changes made to it. The changes can be applied, reverted, validated, and saved.