How do I implement C# style signals or AS3 style events in Scala? I mean mostly observer pattern. To dispatch change events. Thanks.
Or (what’s even better) are there any libraries/framework which do just that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’d suggest reading Deprecating the Observer Pattern first, for inspiration and to get a taste of where things are going.
Then, have a look at how scala-swing uses “reactions” to see how you can do this kind of thing in a library.
Finally, note that first-class functions make implementing the observer pattern yourself relatively easy.