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
This implies that every CallbackProperty is time dependent. But this is not necessarily the case, as shown in this Sandcastle.
In my local app, I have the use case that sometimes, I need to get the current value of such a property elsewhere. I can do this using getValue(time), although I don't need time, so I just pass undefined instead. However, I am using Typescript strict type checking, so the ts compiler does not allow me to pass null or undefined or anything other than a JulianDate. My current workaround is to write getValue(undefined!) , which is syntactically correct, but looks confusing at best, but mostly it looks wrong.
Would it be possible to make the time parameter optional, just as the result parameter? Or would that break something?
The text was updated successfully, but these errors were encountered:
Thanks for the suggestion @anne-gropler! I think it would be fine to mark the time parameter in the callback function signature as optional. We'd be open to review a PR.
However, I think the getValue function would at least need to define a default time to use if undefined. Otherwise, this may break existing callback function that require the time parameter.
Feature
According to the current signature, the callback has 2 params:
time
, of typeJulianDate
result
, an optional objectThis implies that every CallbackProperty is time dependent. But this is not necessarily the case, as shown in this Sandcastle.
In my local app, I have the use case that sometimes, I need to get the current value of such a property elsewhere. I can do this using
getValue(time)
, although I don't needtime
, so I just passundefined
instead. However, I am using Typescript strict type checking, so the ts compiler does not allow me to passnull
orundefined
or anything other than a JulianDate. My current workaround is to writegetValue(undefined!)
, which is syntactically correct, but looks confusing at best, but mostly it looks wrong.Would it be possible to make the
time
parameter optional, just as theresult
parameter? Or would that break something?The text was updated successfully, but these errors were encountered: