Editor commands API / effects (#1778)
This PR shrinks the commands API surface and adds a manager (`CleanupManager`) for side effects. ### Change Type - [x] `major` — Breaking change ### Test Plan Use the app! Especially undo and redo. Our tests are passing but I've found more cases where our coverage fails to catch issues. ### Release Notes - tbd
This commit is contained in:
parent
03514c00c4
commit
e17074a8b3
139 changed files with 3741 additions and 2701 deletions
|
@ -33,7 +33,7 @@ export function createTLStore({ initialData, defaultName = '', ...rest }: TLStor
|
|||
'schema' in rest
|
||||
? rest.schema
|
||||
: createTLSchema({
|
||||
shapes: shapesOnCurrentPageToShapeMap(checkShapesAndAddCore(rest.shapeUtils)),
|
||||
shapes: currentPageShapesToShapeMap(checkShapesAndAddCore(rest.shapeUtils)),
|
||||
})
|
||||
return new Store({
|
||||
schema,
|
||||
|
@ -44,7 +44,7 @@ export function createTLStore({ initialData, defaultName = '', ...rest }: TLStor
|
|||
})
|
||||
}
|
||||
|
||||
function shapesOnCurrentPageToShapeMap(shapeUtils: TLShapeUtilConstructor<TLUnknownShape>[]) {
|
||||
function currentPageShapesToShapeMap(shapeUtils: TLShapeUtilConstructor<TLUnknownShape>[]) {
|
||||
return Object.fromEntries(
|
||||
shapeUtils.map((s): [string, SchemaShapeInfo] => [
|
||||
s.type,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue