Data classes for event wrappers

#112 · closed · 3 comments

View on GitHub ↗

octa-one

What do you think about converting "event wrapper" classes to data classes? (TextChangeEvent, ScrollEvent, EditorActionEvent, etc) I see at least two improvements: * `distinctUntilChanged` will work correctly with overloaded `equals` * ability to use destructuring declaration in `collect` lambdas, for example: ```kotlin // w/o data class textView.textChangeEvents().collect { doSmth(it.view, it.text) } // with data class textView.textChangeEvents().collect { (view, text, _, _, _) -> doSmth(view, text) } ```

Comments

ychescale9

I agree it's a good idea and thanks for the destructuring example. This change will change the ABI although I'm not too concerned since converting to a data class should be binary compatible change.

octa-one

Great, thanks for the quick response!

ychescale9

This change is now available in `1.0.0-beta02`.