kopia lustrzana https://github.com/Tldraw/Tldraw
put `getCurrentPageId` into a computed (#3378)
This PR makes the `getCurrentPageId` method use a computed. Previously, anything that referenced the current page id would pick up any change to instance state. This will help a bunch of interactions like brushing that would update the instance state on every frame. ### Change Type - [x] `sdk` — Changes the tldraw SDK - [x] `improvement` — Improving existing featurespull/3377/head^2
rodzic
f1e0af7631
commit
4d32a38cf8
|
@ -3325,7 +3325,7 @@ export class Editor extends EventEmitter<TLEventMap> {
|
|||
*
|
||||
* @public
|
||||
*/
|
||||
getCurrentPageId(): TLPageId {
|
||||
@computed getCurrentPageId(): TLPageId {
|
||||
return this.getInstanceState().currentPageId
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue