From 6cd498a1ed6420c04a1a522115a381eb0e4bff75 Mon Sep 17 00:00:00 2001 From: Steve Ruiz Date: Thu, 11 Apr 2024 17:57:14 +0100 Subject: [PATCH] Remove docs for Editor.batch (#3451) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove misleading docs for `Editor.batch`. ### Change Type - [x] `sdk` — Changes the tldraw SDK - [x] `bugfix` — Bug fix --- packages/editor/api/api.json | 2 +- packages/editor/src/lib/editor/Editor.ts | 14 +------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/packages/editor/api/api.json b/packages/editor/api/api.json index d6c01d768..6945f077c 100644 --- a/packages/editor/api/api.json +++ b/packages/editor/api/api.json @@ -7947,7 +7947,7 @@ { "kind": "Method", "canonicalReference": "@tldraw/editor!Editor#batch:member(1)", - "docComment": "/**\n * Run a function in a batch, which will be undone/redone as a single action.\n *\n * @example\n * ```ts\n * editor.batch(() => {\n * \teditor.selectAll()\n * \teditor.deleteShapes(editor.getSelectedShapeIds())\n * \teditor.createShapes(myShapes)\n * \teditor.selectNone()\n * })\n *\n * editor.undo() // will undo all of the above\n * ```\n *\n * @public\n */\n", + "docComment": "/**\n * Run a function in a batch.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", diff --git a/packages/editor/src/lib/editor/Editor.ts b/packages/editor/src/lib/editor/Editor.ts index df7df0c50..4f1b12f72 100644 --- a/packages/editor/src/lib/editor/Editor.ts +++ b/packages/editor/src/lib/editor/Editor.ts @@ -885,19 +885,7 @@ export class Editor extends EventEmitter { } /** - * Run a function in a batch, which will be undone/redone as a single action. - * - * @example - * ```ts - * editor.batch(() => { - * editor.selectAll() - * editor.deleteShapes(editor.getSelectedShapeIds()) - * editor.createShapes(myShapes) - * editor.selectNone() - * }) - * - * editor.undo() // will undo all of the above - * ``` + * Run a function in a batch. * * @public */