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
In the type signature for action$ the PLATFORM for RequestEventAction defaults to unknown, unlike in loader$ where you can pass a generic type.
Describe the solution you'd like
Add a generic type to action$ that gets passed to RequestEventAction so that you can specify the PLATFORM. The same way that is possible to do it for loader$.
OR
Similar to Remix have both loader$ and action$ use an empty interface that is exposed for PLATFORM instead of a generic type. This would make it so that you can make one declaration app-wide. (link to Remix MR that did something similar)[https://github.com/remix-run/remix/pull/1876 ].
In Remix they have AppLoadContext that is their equivalent of PLATFORM. By including a declaration file like below you can merge it and have AppLoadContext be whatever you want in the application. So you don't have to type AppLoadContext at each instance when you use a loader or an action.
However it seems that loader$ is not having this properly applied to it. loader$ uses RequestEventLoader_2 which defaults to QwikCityPlatform ❤️ however 😨 the generic for RequestEventLoader_2 is being set by the loader$ function which defaults it to unknown, so even if QwikCityPlatform is defined it ends up being unknown.
Is your feature request related to a problem?
Love using qwik! I hope I'm doing this correctly.
In the type signature for
action$
thePLATFORM
forRequestEventAction
defaults to unknown, unlike inloader$
where you can pass a generic type.Describe the solution you'd like
Add a generic type to
action$
that gets passed toRequestEventAction
so that you can specify thePLATFORM
. The same way that is possible to do it forloader$
.OR
Similar to Remix have both
loader$
andaction$
use an empty interface that is exposed forPLATFORM
instead of a generic type. This would make it so that you can make one declaration app-wide. (link to Remix MR that did something similar)[https://github.com/remix-run/remix/pull/1876 ].In Remix they have
AppLoadContext
that is their equivalent ofPLATFORM
. By including a declaration file like below you can merge it and haveAppLoadContext
be whatever you want in the application. So you don't have to typeAppLoadContext
at each instance when you use a loader or an action.Describe alternatives you've considered
platform
to the proper type.@ts-ignore
the errorAdditional context
No response
The text was updated successfully, but these errors were encountered: