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
There are some instances where things in the API are typed as any. E.g. the new onExternalSettingsChange which has its return type typed as any, which according to liam is so that the function can easily be made async.
The same effect can be achieved with something like void | Promise<void> or a generic helper type e.g.
typeMaybePromise<T>=T|Promise<T>;
That way the function can be typed as
onExternalSettingsChange?(): MaybePromise<void>;
Which would make it clear that the function can be async and returns nothing.
The text was updated successfully, but these errors were encountered:
This is an unnecessary move that would end up restricting the type and complicating the type compiler. Using any means "our API does not care what you return, whether it's void, number, Promise<something>, it doesn't matter.
Your suggestion makes it impossible to return non-void types, which is not something we care about.
There are some instances where things in the API are typed as
any
. E.g. the newonExternalSettingsChange
which has its return type typed asany
, which according to liam is so that the function can easily be made async.The same effect can be achieved with something like
void | Promise<void>
or a generic helper type e.g.That way the function can be typed as
Which would make it clear that the function can be async and returns nothing.
The text was updated successfully, but these errors were encountered: