@@ -269,6 +269,19 @@ <h2 style="margin-top: 30px;">📄 Results</h2>
269269 // The @objectql /sdk package automatically includes a polyfill for older browsers!
270270
271271 // Simple DataApiClient implementation for demo
272+ // This includes the same polyfill approach as the real SDK
273+
274+ // Helper function to create timeout signal with fallback
275+ function createTimeoutSignal ( ms ) {
276+ if ( typeof AbortSignal !== 'undefined' && AbortSignal . timeout ) {
277+ return AbortSignal . timeout ( ms ) ;
278+ }
279+ // Fallback for older browsers
280+ const controller = new AbortController ( ) ;
281+ setTimeout ( ( ) => controller . abort ( ) , ms ) ;
282+ return controller . signal ;
283+ }
284+
272285 class DataApiClient {
273286 constructor ( config ) {
274287 this . baseUrl = config . baseUrl . replace ( / \/ $ / , '' ) ;
@@ -301,7 +314,7 @@ <h2 style="margin-top: 30px;">📄 Results</h2>
301314 method,
302315 headers,
303316 body : body ? JSON . stringify ( body ) : undefined ,
304- signal : AbortSignal . timeout ( this . timeout )
317+ signal : createTimeoutSignal ( this . timeout )
305318 } ) ;
306319
307320 return await response . json ( ) ;
@@ -345,7 +358,7 @@ <h2 style="margin-top: 30px;">📄 Results</h2>
345358 const response = await fetch ( `${ this . baseUrl } ${ path } ` , {
346359 method,
347360 headers,
348- signal : AbortSignal . timeout ( this . timeout )
361+ signal : createTimeoutSignal ( this . timeout )
349362 } ) ;
350363
351364 return await response . json ( ) ;
0 commit comments