Skip to content

Instantly share code, notes, and snippets.

@ShikaSD
Created July 22, 2019 16:24
Show Gist options
  • Save ShikaSD/625fdc3e8f7a253e85264a56213c01ea to your computer and use it in GitHub Desktop.
Save ShikaSD/625fdc3e8f7a253e85264a56213c01ea to your computer and use it in GitHub Desktop.
Diff API
onChange(
TextModel::textStyle,
callback {
DesignSystemConfigurationsHolder.textComponentConfigurator.applyStyle(it, this@TextComponent)
textStyle = it
}
)
onChange(
TextModel::action,
callback(
update = { action -> setOnClickListener { action() } },
clear = {
setOnClickListener(null)
isClickable = false
}
)
)
TextModel::textStyle onChange callback {
DesignSystemConfigurationsHolder.textComponentConfigurator.applyStyle(it, this@TextComponent)
textStyle = it
}
TextModel::action onChange callback(
update = { action -> setOnClickListener { action() } },
clear = {
setOnClickListener(null)
isClickable = false
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment