SolidJSS
SolidJSโ€ข3y agoโ€ข
3 replies
phungleson

Handle union type in store

Hi peeps,

I would like to store union type like this type Post = NewPost | DeletedPost; in a store.

https://playground.solidjs.com/anonymous/7210c31b-5730-4e51-b875-3d8e2f36af4c

It seems to work but I wonder if there is a way to tell solid more about the types and avoid type check errors?

Thanks!
Was this page helpful?