Currently, the client is duplicated each time createRoute is used. To prevent this duplication, we can create a new package named @agrume/optimized-client. This package will export an optimizedClient that would simply be a short way to global.__agrumeClient, and a side-effect that will assign the default client to global.__agrumeClient. This side-effect should be imported in the main.tsx (or similar, basically the root/entry point), and the optimizedClient could either be utilized in the global config, or in the options of the createRoute function.
Currently, the client is duplicated each time
createRoute
is used. To prevent this duplication, we can create a new package named@agrume/optimized-client
. This package will export anoptimizedClient
that would simply be a short way toglobal.__agrumeClient
, and a side-effect that will assign the default client toglobal.__agrumeClient
. This side-effect should be imported in themain.tsx
(or similar, basically the root/entry point), and theoptimizedClient
could either be utilized in the global config, or in the options of thecreateRoute
function.