Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend API for creating the CommandMessageForm component #59

Merged
merged 6 commits into from
Oct 16, 2024

Conversation

Artem-Semenov-dev
Copy link
Contributor

This PR enhances the CommandMessageForm component creation by using the invoke operator. It adds a parameter that allows to programmatically amend the message before the form is submitted.

@Artem-Semenov-dev Artem-Semenov-dev self-assigned this Oct 15, 2024
@Artem-Semenov-dev Artem-Semenov-dev marked this pull request as ready for review October 15, 2024 14:08
Copy link
Contributor

@armiol armiol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Artem-Semenov-dev see my suggestion prior to merging.

*/
@Composable
public operator fun <C : CommandMessage, B: ValidatingBuilder<out C>> invoke(
builder: () -> B,
value: MutableState<C?> = mutableStateOf(null),
onBeforeBuild: B.() -> Unit = {},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about making this lambda return B?

Otherwise, we only are able to change it by reference.

@Artem-Semenov-dev Artem-Semenov-dev merged commit aec1a89 into master Oct 16, 2024
5 checks passed
@Artem-Semenov-dev Artem-Semenov-dev deleted the command-message-form-creation branch October 16, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants