File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -539,13 +539,14 @@ class Router extends Framework7Class {
539539 }
540540 }
541541 router . xhrAbortController = new AbortController ( ) ;
542- const options = {
542+ const fetchOptions = {
543543 method : 'GET' ,
544544 signal : router . xhrAbortController . signal ,
545545 } ;
546- router . emit ( 'routerAjaxStart' , options ) ;
546+ router . emit ( 'routerAjaxStart' , options , fetchOptions ) ;
547547 let fetchRes ;
548- fetch ( url , options ) . then ( res => {
548+ fetch ( url , fetchOptions )
549+ . then ( ( res ) => {
549550 fetchRes = res ;
550551 return res . text ( ) ;
551552 } )
Original file line number Diff line number Diff line change @@ -247,6 +247,8 @@ export namespace Router {
247247 /** Event will be fired when router.updateCurrentUrl method called */
248248 routeUrlUpdate ( newRoute : Route , router : Router ) : void ;
249249
250+ /** Event will be fired when the request starts. As an arguments receives navigating options object and request init object */
251+ routerAjaxStart ( options : RouteOptions , requestInit : RequestInit ) : void ;
250252 /** Event will be fired when the request succeeds. As an arguments receives XHR object and navigating options object */
251253 routerAjaxSuccess ( response : Response , options : RouteOptions ) : void ;
252254 /** Event will be fired if the request fails. As an arguments receives XHR object and navigating options object */
You can’t perform that action at this time.
0 commit comments