@@ -37,7 +37,7 @@ type MemoizedLifeCycle<T> = {
3737type LocationChangeCallback = (
3838 location : Location < NextHistoryState > ,
3939 prevLocation : Location < NextHistoryState >
40- ) => Promise < boolean | null > ;
40+ ) => Promise < boolean > ;
4141
4242interface IncrementalRenderState {
4343 parentRoutes : RouteConf [ ] ;
@@ -71,7 +71,12 @@ export interface RendererContextOptions {
7171export interface RouteHelper {
7272 bailout : ( output : RenderOutput ) => true | undefined ;
7373 mergeMenus : ( menuRequests : Promise < StaticMenuConf > [ ] ) => Promise < void > ;
74- /** Will always resolve */
74+ /**
75+ * Will always resolve when the routing is not the current bootstrap.
76+ * Otherwise, will throw an error when not bailout.
77+ *
78+ * @returns undefined when bailout, or failed output otherwise
79+ */
7580 catch : (
7681 error : unknown ,
7782 returnNode : RenderReturnNode ,
@@ -226,7 +231,10 @@ export class RendererContext {
226231 }
227232
228233 /**
229- * Will always resolve
234+ * Will always resolve when the routing is not the current bootstrap.
235+ * Otherwise, will throw an error when not bailout.
236+ *
237+ * @returns undefined when bailout, or failed output otherwise
230238 */
231239 reCatch ( error : unknown , returnNode : RenderReturnNode ) {
232240 return this . #routeHelper! . catch ( error , returnNode , false , true ) ;
@@ -255,8 +263,7 @@ export class RendererContext {
255263 continue ;
256264 }
257265 const result = await callback ( location , prevLocation ) ;
258- // When result is null, it means the incremental rendering is tried but routes missed.
259- // In this case, we should continue to re-render the parent routes.
266+ // When result is true, it means the incremental rendering is performed.
260267 if ( result ) {
261268 shouldIgnoreRoutes . push ( ...parentRoutes . slice ( 0 , - 1 ) ) ;
262269 }
0 commit comments