Reverts the current item to its saved value.
The revert()
function returns a Promise that is resolved
when:
Calling revert()
on a read-only dataset causes the Promise to reject.
Note:
A dataset needs to load its data before you call its revert()
function.
Usually a dataset finishes loading a short time after the page it is on finishes
loading. So if you call revert()
inside the page’s onReady()
event handler, the dataset might not be ready yet.
To call revert()
as soon as possible after a page loads, use the dataset's
onReady()
function inside the page’s onReady()
event handler to ensure that both the page and the dataset have finished loading.