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

Add context generic for LoaderFunction/ActionFunction #93

Closed
ryanflorence opened this issue Mar 2, 2021 · 2 comments
Closed

Add context generic for LoaderFunction/ActionFunction #93

ryanflorence opened this issue Mar 2, 2021 · 2 comments

Comments

@ryanflorence
Copy link
Member

Instead of this disaster:

type KCDLoader = (
  args: Omit<Parameters<Loader>['0'], 'context'> & {context: LoaderContext},
) => ReturnType<Loader>

type KCDAction = (
  args: Omit<Parameters<Action>['0'], 'context'> & {context: LoaderContext},
) => ReturnType<Action>

People can do this:

export let loader: LoaderFunction<KCDLoaderContext> = ({ context }) => {

}
@tylerbrostrom
Copy link
Contributor

tylerbrostrom commented Mar 2, 2021

Might it be worthwhile to also make MetaFunction and LinksFunction generic with respect to the args.data property?

@machour
Copy link
Collaborator

machour commented Mar 15, 2022

This can now be closed

@machour machour closed this as completed Mar 17, 2022
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

No branches or pull requests

3 participants