Skip to content

Improve types for the load wrapper #52

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fehnomenal
Copy link

Before this change you would just get a "generic" ServerLoadEvent, i.e. without params or route id set:

grafik

Adding satisfies LayoutServerLoad to the passed function works but gives an error about the route id:

grafik

  Type 'string | null' is not assignable to type 'LayoutRouteId'.
    Type 'string' is not assignable to type 'LayoutRouteId'.ts(2345)

After this change no error is shown and not even the satisfies is needed (at least for autocomplete; I think eslint still requires it).

@fehnomenal fehnomenal marked this pull request as ready for review April 25, 2025 09:09
@ciscoheat
Copy link
Owner

Thank you! Will merge asap when I've checked it out locally.

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 this pull request may close these issues.

2 participants