Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Bypass having to type client loader #19

Closed
imp-dance opened this issue Jan 13, 2025 · 0 comments · Fixed by #22
Closed

Feature request: Bypass having to type client loader #19

imp-dance opened this issue Jan 13, 2025 · 0 comments · Fixed by #22

Comments

@imp-dance
Copy link

imp-dance commented Jan 13, 2025

Could be integrated with a helper like such:

export const createClientLoaderCache = (props: CacheClientLoaderArgs) => {
  const clientLoader = (args: ClientLoaderFunctionArgs) => cacheClientLoader(args, props);
  clientLoader.hydrate = true;
  return clientLoader;
};

And then used like such:

export const loader = () => {...};

// no need to manually add wrapper function with "ClientLoaderFunctionArgs" type
export const clientLoader = createClientLoaderCache();
// can still pass options
export const clientLoader = createClientLoaderCache({ key: "my-custom-key" });
@AlemTuzlak AlemTuzlak linked a pull request Jan 21, 2025 that will close this issue
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant