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
stormy-gold•8mo ago
it won't work at compile time with automatic code splitting though
we currently don't support abstractions on top of createFileRoute
passive-yellowOP•8mo ago
So I guess the best alternative way to accomplish this is to pass all the predefined options to each
createFileRoute separately?
stormy-gold•8mo ago
yes
passive-yellowOP•8mo 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
stormy-gold•8mo 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
passive-yellowOP•8mo ago
ok, looking forward for that. thank you