Here's a helper function for your +page.server 🔥 #86
multiplehats
started this conversation in
Show and tell
Replies: 1 comment
-
@icflorescu maybe useful to include in the docs? Been other q's regarding this: #56 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Been using tRPC more and more. But I realised I was repeating imports in my
+page.server
and I also wanted the ability to parallel load.EDIT: Decided to write a quick article about this in more detail, you can find it here.
I created a simple util that will try catch, and rethrow with the right SvelteKit error object. Types are of course inferred.
Utility
trpc-load.ts
Usage:
+page.server.ts
Hopefully this helps someone!
Beta Was this translation helpful? Give feedback.
All reactions