What's the meaning of plus sign before a Kotlin method?

前端 未结 1 1139
太阳男子
太阳男子 2021-01-04 13:47

I\'m studiyng Kotlin and was watching the AndroidDevSummit, more specifically the presentation \"Undestanding Compose\" from Leland Richardson.

While the presentatio

相关标签:
1条回答
  • 2021-01-04 14:31

    + is kind of like an operator invoke for effects. The functions that return effects just return an object for the effect and the + says, "add it into the composition here"

    by Adam Powell on Kotlin Slack

    The full thread on kotlin slack

    The + operator will be removed in the future, for states, probably will use Property Delegates, something like this: var myState by state { "value" }

    0 讨论(0)
提交回复
热议问题