C#-like signals or AS3-like events in Scala?
How do I implement C# style signals or AS3 style events in Scala? I mean mostly observer pattern. To dispatch change events. Thanks.
Or (wha开发者_JAVA技巧t's even better) are there any libraries/framework which do just that?
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.
精彩评论