These are chat archives for ThoughtWorksInc/Binding.scala

20th
Apr 2018
Andrzej Sołtysik
@asoltysik
Apr 20 2018 06:23
my guess is it won't work, but you can try ;)
since AFAIK only the outer function will be @dom annotated, and the function returned from it will be out of scope of it, but I am happy to be proved wrong
杨博 (Yang Bo)
@Atry
Apr 20 2018 06:26
@mcku If you are talking about methods with multiple lists of parameters, it just works as other methods.
But if you are talking about @dom on Function1 values, then you will have Binding[A => B].
It could be useful if you want to switch event handler according to upstream data changes.
Check the blurHandler in TodoMVC for instance https://github.com/ThoughtWorksInc/todo/blob/796386b/js/src/main/scala/com/thoughtworks/todo/Main.scala#L90
ritschwumm
@ritschwumm
Apr 20 2018 16:29
@Atry redux' implementation is a bit convoluted, but in the end it's (roughly) just a bunch of dumb data structures called Action and a function type Action => State => State called Reducer.
杨博 (Yang Bo)
@Atry
Apr 20 2018 18:53
Dsl has a method def interpret(keyword: Keyword, handler: (Value) ⇒ Domain): Domain
Looks like Redux
Wait... It's different. (A => B) => B is not A => B => B
I hate curried functions. I always misread them.