File tree Expand file tree Collapse file tree 4 files changed +12
-12
lines changed Expand file tree Collapse file tree 4 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ export default class CallbackRegistry<T> {
2929 this . registryType = registryType ;
3030 }
3131
32- private async initializeTimeoutEvents ( ) {
32+ private initializeTimeoutEvents ( ) {
3333 if ( this . timeoutEventsInitialized ) return ;
3434 this . timeoutEventsInitialized = true ;
3535
@@ -46,14 +46,14 @@ export default class CallbackRegistry<T> {
4646 } ) ;
4747 } ;
4848
49- await onPageLoaded ( ( ) => {
49+ onPageLoaded ( ( ) => {
5050 const registryTimeout = getContextAndRailsContext ( ) . railsContext ?. componentRegistryTimeout ;
5151 if ( ! registryTimeout ) return ;
5252
5353 timeoutId = setTimeout ( triggerTimeout , registryTimeout ) ;
5454 } ) ;
5555
56- await onPageUnloaded ( ( ) => {
56+ onPageUnloaded ( ( ) => {
5757 this . waitingPromises . clear ( ) ;
5858 this . timedout = false ;
5959 clearTimeout ( timeoutId ) ;
@@ -97,7 +97,7 @@ export default class CallbackRegistry<T> {
9797 }
9898
9999 async getOrWaitForItem ( name : string ) : Promise < T > {
100- await this . initializeTimeoutEvents ( ) ;
100+ this . initializeTimeoutEvents ( ) ;
101101 try {
102102 return this . get ( name ) ;
103103 } catch ( error ) {
Original file line number Diff line number Diff line change @@ -343,7 +343,7 @@ ctx.ReactOnRails = {
343343
344344ctx . ReactOnRails . resetOptions ( ) ;
345345
346- void ClientStartup . clientStartup ( ctx ) ;
346+ ClientStartup . clientStartup ( ctx ) ;
347347
348348export * from './types' ;
349349export default ctx . ReactOnRails ;
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ function reactOnRailsPageUnloaded(): void {
1919 unmountAll ( ) ;
2020}
2121
22- export async function clientStartup ( context : Context ) : Promise < void > {
22+ export function clientStartup ( context : Context ) {
2323 // Check if server rendering
2424 if ( ! isWindow ( context ) ) {
2525 return ;
@@ -41,6 +41,6 @@ export async function clientStartup(context: Context): Promise<void> {
4141 void hydrateForceLoadedStores ( ) ;
4242
4343 // Other components and stores are rendered and hydrated when the page is fully loaded
44- await onPageLoaded ( reactOnRailsPageLoaded ) ;
45- await onPageUnloaded ( reactOnRailsPageUnloaded ) ;
44+ onPageLoaded ( reactOnRailsPageLoaded ) ;
45+ onPageUnloaded ( reactOnRailsPageUnloaded ) ;
4646}
Original file line number Diff line number Diff line change @@ -73,17 +73,17 @@ function initializePageEventListeners(): void {
7373 }
7474}
7575
76- export async function onPageLoaded ( callback : PageLifecycleCallback ) : Promise < void > {
76+ export function onPageLoaded ( callback : PageLifecycleCallback ) : void {
7777 if ( currentPageState === 'load' ) {
78- await callback ( ) ;
78+ void callback ( ) ;
7979 }
8080 pageLoadedCallbacks . add ( callback ) ;
8181 initializePageEventListeners ( ) ;
8282}
8383
84- export async function onPageUnloaded ( callback : PageLifecycleCallback ) : Promise < void > {
84+ export function onPageUnloaded ( callback : PageLifecycleCallback ) : void {
8585 if ( currentPageState === 'unload' ) {
86- await callback ( ) ;
86+ void callback ( ) ;
8787 }
8888 pageUnloadedCallbacks . add ( callback ) ;
8989 initializePageEventListeners ( ) ;
You can’t perform that action at this time.
0 commit comments