You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Description
AFAIK, we have
PageServerLoad
,LayoutServerLoad
,PageLoad
,LayoutLoad
andActions
.All those types are available under
./types.ts
.Consider this one:
and this one
As you can see, the
.ts
file will easily get messed up because the nature ofsatisfies
syntax.Solution
Introduce a new type to
./types.ts
:To use it in
+page.server.ts
:The source code now looks a lot more clean and maintainable.
This same idea apply for all
+page.server.ts
,+layout.server.ts
,+page.ts
and+layout.ts
.If users don't like it, they can ignore the new type
Default
and use its child types.Beta Was this translation helpful? Give feedback.
All reactions