File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed
Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change 1- import " ./polyfills" ;
1+ import ' ./polyfills' ;
22// Prioritize bippy side-effect
3- import " bippy" ;
3+ import ' bippy' ;
44
5- import { IS_CLIENT } from " ~web/utils/constants" ;
6- import { scan } from " ./index" ;
5+ import { IS_CLIENT } from ' ~web/utils/constants' ;
6+ import { scan } from ' ./index' ;
77
88if ( IS_CLIENT ) {
99 scan ( ) ;
1010 window . reactScan = scan ;
1111}
1212
13- export * from " ./core" ;
13+ export * from ' ./core' ;
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ export type SlowdownEvent = (InteractionEvent | LongRenderPipeline) & {
104104
105105type ToolbarEventStoreState = {
106106 state : {
107- events : Array < SlowdownEvent > ;
107+ events : BoundedArray < SlowdownEvent > ;
108108 } ;
109109 actions : {
110110 addEvent : ( event : SlowdownEvent ) => void ;
@@ -149,13 +149,15 @@ export const debugEventStore = createStore<{
149149 } ,
150150} ) ) ;
151151
152+ const EVENT_STORE_CAPACITY = 200 ;
153+
152154export const toolbarEventStore = createStore < ToolbarEventStoreState > ( ) (
153155 ( set , get ) => {
154156 const listeners = new Set < ( event : SlowdownEvent ) => void > ( ) ;
155157
156158 return {
157159 state : {
158- events : [ ] ,
160+ events : new BoundedArray ( EVENT_STORE_CAPACITY ) ,
159161 } ,
160162
161163 actions : {
@@ -240,7 +242,10 @@ export const toolbarEventStore = createStore<ToolbarEventStoreState>()(
240242
241243 set ( ( ) => ( {
242244 state : {
243- events : withRemovedEvents ,
245+ events : BoundedArray . fromArray (
246+ withRemovedEvents ,
247+ EVENT_STORE_CAPACITY ,
248+ ) ,
244249 } ,
245250 } ) ) ;
246251 } ,
@@ -255,7 +260,7 @@ export const toolbarEventStore = createStore<ToolbarEventStoreState>()(
255260 clear : ( ) => {
256261 set ( {
257262 state : {
258- events : [ ] ,
263+ events : new BoundedArray ( EVENT_STORE_CAPACITY ) ,
259264 } ,
260265 } ) ;
261266 } ,
You can’t perform that action at this time.
0 commit comments