-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
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
Passing MakeLogicType into the .extend
API
#129
Comments
Hey Constance, thanks for the support! :) I added support for passing the right However, this might not be the function you want to use. When you call If you want more traditional inheritance a'la const SchemaLogic = kea<SchemaLogicType>({
inherit: [SchemaBaseLogic],
path: ['schema'],
actions: {
...
},
}) and the new ... However, even then you might want to just Hope this helps :) |
This looks awesome!!! Thanks so much as always Marius, not least for the super speedy turnaround time ❤️ I'll try to play around with both the new extend typing and awesome-looking |
That's great, closing the issue :) |
Heya Marius, sorry to bother you again!! 👋 Our team has run up into another use case where we'd love to use the .extend() API to share some common listeners/state between 2 similar-ish logic files, but unfortunately we're blocked by typing being fairly broken once we start to use
.extend()
.Here's an example commit of what I was hoping to use extend for: cee-chen/kibana@e51b21c (I've left a few code comments highlighting the problematic type areas in that link).
For now, I've opted to instead use explicit connections (commit ref: cee-chen/kibana@9e46d0e) which gets the typing working again and works excellently for this use case, where there's less than 5 shared values/actions and the 2 files have a minor amount of things in common.
.extend()
would be super useful however for a couple of our other files, where the majority of the values/actions are shared and there's just 1 or two things that differ between views. I was hoping it might be less dev effort to support just MakeLogicType (vs. kea-typegen) for the.extend()
API by passing in some Typescript generics, but I'm definitely not a Typescript expert so could be way off base about that.As always, thanks a million for your awesome work and let me know if I can elaborate further / help at all!
The text was updated successfully, but these errors were encountered: