Expose store, a bit

This commit is contained in:
Marcel Mraz
2025-01-29 17:37:55 +01:00
parent 52eaf64591
commit 245d681b7d
6 changed files with 86 additions and 51 deletions
+2
View File
@@ -739,6 +739,7 @@ class App extends React.Component<AppProps, AppState> {
updateFrameRendering: this.updateFrameRendering,
toggleSidebar: this.toggleSidebar,
onChange: (cb) => this.onChangeEmitter.on(cb),
onIncrement: (cb) => this.store.onStoreIncrementEmitter.on(cb),
onPointerDown: (cb) => this.onPointerDownEmitter.on(cb),
onPointerUp: (cb) => this.onPointerUpEmitter.on(cb),
onScrollChange: (cb) => this.onScrollChangeEmitter.on(cb),
@@ -2462,6 +2463,7 @@ class App extends React.Component<AppProps, AppState> {
this.store.onStoreIncrementEmitter.on((increment) => {
this.history.record(increment.elementsChange, increment.appStateChange);
this.props.onIncrement?.(increment);
});
this.scene.onUpdate(this.triggerRender);