1- import  {  useEffect ,   useState  }  from  "react" ; 
1+ import  {  useEffect  }  from  "react" ; 
22import  {  render  }  from  "react-dom" ; 
3- import  type  {  ApiType  }  from  "../server-api" ; 
4- import  axios  from  "axios" ; 
5- import  {  createBifrost  }  from  "bifrost" ; 
6- import  { 
7-   QueryClient , 
8-   QueryClientProvider , 
9-   useMutation , 
10-   useQueryClient , 
11- }  from  "react-query" ; 
3+ import  {  createServerSDK  }  from  "../server-sdk" ; 
4+ import  {  QueryClient ,  QueryClientProvider ,  useQueryClient  }  from  "react-query" ; 
125
136const  queryClient  =  new  QueryClient ( ) ; 
147
15- const  Bifrost  =  createBifrost < ApiType > ( { 
16-   queryClient, 
17-   doFetch : async  ( {  argument,  path } )  =>  { 
18-     return  axios 
19-       . post ( `http://localhost:8000/${ path . join ( "/" ) }  ` ,  {  argument } ) 
20-       . then ( ( resp )  =>  resp . data ) ; 
21-   } , 
22- } ) ; 
8+ const  {  ServerSDK }  =  createServerSDK ( queryClient ) ; 
239
2410function  App ( )  { 
2511  return  ( 
@@ -31,16 +17,16 @@ function App() {
3117
3218function  AppInner ( )  { 
3319  useEffect ( ( )  =>  { 
34-     Bifrost . sdk . accounts . someCoolAccountsFn ( {  foo : "asdf"  } ) . then ( ( data )  =>  { 
20+     ServerSDK . sdk . accounts . someCoolAccountsFn ( {  foo : "asdf"  } ) . then ( ( data )  =>  { 
3521      console . log ( "Fetched data!" ,  data . someValue ) ; 
3622    } ) ; 
3723  } ,  [ ] ) ; 
3824
39-   const  r2  =  Bifrost . useSDKMutation ( ) . accounts . someCoolAccountsFn ( ) ; 
25+   const  r2  =  ServerSDK . useSDKMutation ( ) . accounts . someCoolAccountsFn ( ) ; 
4026
4127  const  qc  =  useQueryClient ( ) ; 
4228
43-   const  r  =  Bifrost . useSDK ( ) . accounts . anotherCoolAccountsFn ( 
29+   const  r  =  ServerSDK . useSDK ( ) . accounts . anotherCoolAccountsFn ( 
4430    {  bar : 123 ,  blah : "asdf"  } , 
4531    { 
4632      select : ( a )  =>  a . waddup , 
@@ -50,7 +36,7 @@ function AppInner() {
5036  return  ( 
5137    < div 
5238      onClick = { ( )  =>  { 
53-         const  asdf  =  Bifrost . getSDKQueryKey . accounts . anotherCoolAccountsFn ( { 
39+         const  asdf  =  ServerSDK . getSDKQueryKey . accounts . anotherCoolAccountsFn ( { 
5440          blah : "asdf" , 
5541          bar : 123 , 
5642        } ) ; 
0 commit comments