@@ -45,14 +45,14 @@ let currentContext: BasketryExampleContextProps | undefined;
4545
4646export const BasketryExampleProvider : FC <
4747 PropsWithChildren < BasketryExampleContextProps >
48- > = ( { children, fetch , options } ) => {
48+ > = ( { children, ... props } ) => {
4949 const value = useMemo (
50- ( ) => ( { fetch , options } ) ,
50+ ( ) => ( { ... props } ) ,
5151 [
52- fetch ,
53- options . mapUnhandledException ,
54- options . mapValidationError ,
55- options . root ,
52+ props . fetch ,
53+ props . mapUnhandledException ,
54+ props . mapValidationError ,
55+ props . root ,
5656 ] ,
5757 ) ;
5858 currentContext = value ;
@@ -71,8 +71,8 @@ export const getAuthPermutationService = () => {
7171 }
7272 const authPermutationService : AuthPermutationService =
7373 new HttpAuthPermutationService (
74- currentContext . fetch ,
75- currentContext . options ,
74+ currentContext . fetch ?? window . fetch . bind ( window ) ,
75+ currentContext ,
7676 ) ;
7777 return authPermutationService ;
7878} ;
@@ -99,8 +99,8 @@ export const getExhaustiveService = () => {
9999 ) ;
100100 }
101101 const exhaustiveService : ExhaustiveService = new HttpExhaustiveService (
102- currentContext . fetch ,
103- currentContext . options ,
102+ currentContext . fetch ?? window . fetch . bind ( window ) ,
103+ currentContext ,
104104 ) ;
105105 return exhaustiveService ;
106106} ;
@@ -126,8 +126,8 @@ export const getGizmoService = () => {
126126 ) ;
127127 }
128128 const gizmoService : GizmoService = new HttpGizmoService (
129- currentContext . fetch ,
130- currentContext . options ,
129+ currentContext . fetch ?? window . fetch . bind ( window ) ,
130+ currentContext ,
131131 ) ;
132132 return gizmoService ;
133133} ;
@@ -153,8 +153,8 @@ export const getWidgetService = () => {
153153 ) ;
154154 }
155155 const widgetService : WidgetService = new HttpWidgetService (
156- currentContext . fetch ,
157- currentContext . options ,
156+ currentContext . fetch ?? window . fetch . bind ( window ) ,
157+ currentContext ,
158158 ) ;
159159 return widgetService ;
160160} ;
0 commit comments