mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
enable version bumping for collaboration
This commit is contained in:
parent
30903fbe04
commit
1419f17175
8 changed files with 179 additions and 85 deletions
20
src/element/mutateElement.ts
Normal file
20
src/element/mutateElement.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import {
|
||||
MutableExcalidrawElement,
|
||||
MutableExcalidrawTextElement,
|
||||
} from "./types";
|
||||
|
||||
export function mutateElement(
|
||||
element: MutableExcalidrawElement,
|
||||
callback: (mutatableElement: MutableExcalidrawElement) => void,
|
||||
): void {
|
||||
element.version++;
|
||||
callback(element);
|
||||
}
|
||||
|
||||
export function mutateTextElement(
|
||||
element: MutableExcalidrawTextElement,
|
||||
callback: (mutatableElement: MutableExcalidrawTextElement) => void,
|
||||
): void {
|
||||
element.version++;
|
||||
callback(element);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue