Typing a factory function for createFileRoute
Hello everyone, I am trying to create a factory function that returns a
createFileRoute
with some options predefined, but I am not able to type it correctly with all the generics. Here is an example what I am trying to accomplish:
Can someone help me with the correct types? Thanks in advance.6 Replies
apparent-cyan•5mo ago
it won't work at compile time with automatic code splitting though
we currently don't support abstractions on top of createFileRoute
correct-apricotOP•5mo ago
So I guess the best alternative way to accomplish this is to pass all the predefined options to each
createFileRoute
separately?
apparent-cyan•5mo ago
yes
correct-apricotOP•5mo ago
And are there any plans of supporting this kind of abstractions? I have quite a lot of routes with the same options, so it would be much better to use that way
apparent-cyan•5mo ago
it's in my wishlist
but quite involved due to the static analysis the compiler needs to do for this
not a high priority right now
correct-apricotOP•5mo ago
ok, looking forward for that. thank you