Skip to content

Commit 5d3a2e2

Browse files
committed
Rename
1 parent d9162af commit 5d3a2e2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/core/editable.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export const editable = <T>(
166166
const document = getCurrentDocument(element);
167167

168168
const history = createHistory<
169-
readonly [value: DocFragment, selection: SelectionSnapshot]
169+
readonly [doc: DocFragment, selection: SelectionSnapshot]
170170
>([
171171
takeDomSnapshot(document, element, parserConfig, serializeVoid),
172172
currentSelection,
@@ -204,7 +204,7 @@ export const editable = <T>(
204204

205205
const restoreSelectionOnTimeout = () => {
206206
// We set updated selection after the next rerender, because it will modify DOM and selection again.
207-
// However frameworks may not rerender for optimization in some case, for example if selection is updated but value is the same.
207+
// However frameworks may not rerender for optimization in some case, for example if selection is updated but document is the same.
208208
// So we also schedule restoring on timeout for safe.
209209
const nextSelection = currentSelection;
210210
restoreSelectionQueue = setTimeout(() => {
@@ -259,14 +259,14 @@ export const editable = <T>(
259259

260260
observer._accept(false);
261261
if (queue.length) {
262-
// Get current value and selection from DOM
262+
// Get current document and selection from DOM
263263
const selection = takeSelectionSnapshot(
264264
document,
265265
element,
266266
isSingleline,
267267
parserConfig
268268
);
269-
const value = takeDomSnapshot(
269+
const doc = takeDomSnapshot(
270270
document,
271271
element,
272272
parserConfig,
@@ -301,7 +301,7 @@ export const editable = <T>(
301301
parserConfig
302302
);
303303

304-
updateState(value, selection, currentSelection);
304+
updateState(doc, selection, currentSelection);
305305
}
306306
};
307307

0 commit comments

Comments
 (0)