Design-Patterns-In-Kotlin icon indicating copy to clipboard operation
Design-Patterns-In-Kotlin copied to clipboard

Wrong usage of an Observer/Listener pattern example

Open hawklike opened this issue 5 years ago • 0 comments

I suppose that the usage example of Observer/Listener should be this:

val textView = TextView().apply {
    listeners.add(PrintingTextChangedListener())
}

with(textView) {
    text = "Lorem ipsum"
    text = "dolor sit amet"
}

It is right in the pattern detail though.

hawklike avatar Nov 11 '20 18:11 hawklike