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
As originally described in the answer to #2, now that there is no possibility to define implicit conversions from Observable<T> to T, preferred way of getting the value out of the optional is via a postfix operator ^:
lety=doSomething(x^)
The main reason for it to be postfix is to allow easy chaining with similar syntax to optional chaining:
// .value is just too long in some caseslety1= obj.property.value.whatever.value.sthElse.value
// prefix requires parentheseslety2= ^(^(^obj.property).whatever).sthElse
// postfix allows nice chaininglety3= obj.property^.whatever^.sthElse^
However, for ^ to really be useful there is probably also need for ^! and ^?, because with optionals you now have to use parentheses, which kind of defeats the whole purpose:
letz=(me.friend^)!.lastName^
The text was updated successfully, but these errors were encountered:
As originally described in the answer to #2, now that there is no possibility to define implicit conversions from
Observable<T>
toT
, preferred way of getting the value out of the optional is via a postfix operator^
:The main reason for it to be postfix is to allow easy chaining with similar syntax to optional chaining:
However, for
^
to really be useful there is probably also need for^!
and^?
, because with optionals you now have to use parentheses, which kind of defeats the whole purpose:The text was updated successfully, but these errors were encountered: