UpdateHandler
This callback is invoked whenever the Quick Editor produces a result. The result is represented by a QuickEditorUpdateType
instance, which can be one of several variants. Developers should implement this callback to handle the specific result types appropriately.
Expected use cases:
AvatarPickerResult
: Indicates that the user has updated their avatar. This result does not carry any additional data and serves as a signal to refresh the avatar display.AboutEditorResult
: Contains an updatedProfile
object after the user edits their "About Me" section. This result should be used to update the user's profile information in the application.
Example usage:
val updateHandler: UpdateHandler = { result ->
when (result) {
is AvatarPickerResult -> refreshAvatar()
is AboutEditorResult -> updateProfile(result.profile)
}
}
Content copied to clipboard