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
It's not actually an error. You are just missing some interface for produce. Add a Count interface and provide it as a generic type for produce like the code below.
Thanks @mackignacio!
While your solution works I assumed that the original intent was that explicit interface should not be necessary because TS should be able to infer the types. This would greatly improve the ergonomics of produce.
@ryansolid is my assumption correct?
In any case please treat this ticket as a request for making the generic optional (inferable) :)
I tried to dig into the types of produce and setStore and fix it myself but oh boy they're complex lol
Indeed there are more places to take a stab at improving inference, plus making the source code itself more type safe. Just run Go To Definition in VS Code on produce and that'll take you right to it.
Activity
mac-ignacio commentedon Nov 26, 2021
It's not actually an error. You are just missing some interface for
produce. Add aCountinterface and provide it as a generic type forproducelike the code below.bgoscinski commentedon Nov 26, 2021
Thanks @mackignacio!
While your solution works I assumed that the original intent was that explicit interface should not be necessary because TS should be able to infer the types. This would greatly improve the ergonomics of produce.
@ryansolid is my assumption correct?
In any case please treat this ticket as a request for making the generic optional (inferable) :)
I tried to dig into the types of produce and setStore and fix it myself but oh boy they're complex lol
davedbase commentedon Nov 26, 2021
@trusktr has been reviewing our types maybe he has an opinion on this. Also lol...wait until you see some of the new TS types coming. Weeeee
mac-ignacio commentedon Nov 27, 2021
@trusktr I can help with the types if needed. Just show me where to start.
trusktr commentedon Dec 12, 2021
Indeed there are more places to take a stab at improving inference, plus making the source code itself more type safe. Just run
Go To Definitionin VS Code onproduceand that'll take you right to it.feat(store): improve store types
feat(store): improve store types
refactor(store): improve store types
refactor(store): improve store types
refactor(store): improve store types
refactor(store): improve store types
refactor(store): improve store types
refactor(store): improve store types
refactor(store): improve store types
refactor(store): improve store types
refactor(store): improve store types
refactor(store): improve store types
refactor(store): improve store types (#763)
refactor(store): improve store types (solidjs#763)