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
I'm not sure why we need to export Quantity? It is only types that are exported. If you want to construct an amount I guess the Quantity type parameters is always infered from the unit:
constamount=Amount.create(10,Units.Meter);
What would be an example usage of Quantity as it is exported now?
The text was updated successfully, but these errors were encountered:
However when you are typing something like an amount, you can use Units to get the quantity type. This is becuase Units exports type for all quantities, and const for all units. So if you use Units.Foo where typescript expects a type, you will get the quantity type Foo. If you use Units.Foo where typescript expect an actual value, you will get the unit Foo.
So the above example can be written without Quantity like this:
I'm not sure why we need to export
Quantity
? It is only types that are exported. If you want to construct an amount I guess the Quantity type parameters is always infered from the unit:What would be an example usage of
Quantity
as it is exported now?The text was updated successfully, but these errors were encountered: