utrain
How to make setStore treat a class/interface as an opaque value instead of a partiable one?
So, I'm currently using a UOM library called @buge/ts-units. It has this interface called Quantity that I want to use in my stores. For example:
The problem is that whenever I want to use
setStore
with the path syntax, this is allowed:
It seems to be because in Typescript, the type used for the last argument is Partial<Length>, which allows a number(???) to be accepted. Ignoring that, I would want to treat Length
as a opaque, unpatchable, immutable value just like any other primitive type (boolean, number, bigint, et cetera). The work around I found is essentially avoiding the path syntax and merge at the top-level:
4 replies