Roman Levinzon
Mar 22, 2024

--

Why do you claim that UDF is a waste of time if you are still using it? Slightly different implementation details but, UDF none the less: Pass the state down and use callbacks (now one with event) for other component to handle

Nobody likes a bunch of callbacks, we can agree on that, but I find grouping lambdas into classes much simpler

data class LoginActions(

val onLoginButtonClicked: () -> Unit,

val onEmailChange: (String) -> Unit,

val onPasswordChange: (String) -> Unit

)

And there is no need for sealed classes and complex hierarchies, everything remains rather simple and can passed down with ease

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Roman Levinzon
Roman Levinzon

Written by Roman Levinzon

A Software Engineer with passion for Mobile Technologies

Responses (1)

Write a response