We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kea-typegen
kea
typescript
import {Post} from './types'; const postLogic = kea<postLogicType>([ actions({ updateValue: <T extends keyof Post>(key: T, value: Post[T]) => ({key, value}) }) ])
export interface postLogicType extends Logic { actionCreators: { updateValue: (key: T, value: Post[T]) => ({ type: "update post value (post.*)"; payload: { key: T; value: PostVariant[T]; }; }); }, actions: { updateValue: (key: T, value: PostVariant[T]) => void; } }
In both actionCreators and actions, the generic T is added, but there is no reference to T (Therefore typescript code is invalid).
actionCreators
actions
T
It should add <T extends keyof Post> in function definitions within actionCreators and actions.
<T extends keyof Post>
(Unless there is another way to use generics in actions?)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Environment
kea-typegen
version: 3.0.0kea
version: 3.0.1typescript
version: 4.6.4This logic:
Produces this type:
In both
actionCreators
andactions
, the genericT
is added, but there is no reference toT
(Therefore typescript code is invalid).It should instead:
It should add
<T extends keyof Post>
in function definitions withinactionCreators
andactions
.(Unless there is another way to use generics in actions?)
The text was updated successfully, but these errors were encountered: