close method
Stops the sync, writes what is still waiting, then closes the document and the storage.
Dispose what the app built on document first, such as an undo manager. Calling it twice is safe.
Implementation
Future<void> close() {
return _closing ??= _release(
document,
persistence,
_backend,
client: client,
ownsStorage: _ownsStorage,
);
}