sveltekit-flash-message
sveltekit-flash-message copied to clipboard
Improve types for the load wrapper
Before this change you would just get a "generic" ServerLoadEvent, i.e. without params or route id set:
Adding satisfies LayoutServerLoad to the passed function works but gives an error about the route id:
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).
Thank you! Will merge asap when I've checked it out locally.