]> gitweb.factorcode.org Git - factor.git/commitdiff
switch models reupdate on second switch
authorSam Anklesaria <sam@Tintin.local>
Mon, 1 Jun 2009 12:39:07 +0000 (07:39 -0500)
committerSam Anklesaria <sam@Tintin.local>
Mon, 1 Jun 2009 12:39:07 +0000 (07:39 -0500)
extra/ui/frp/signals/signals.factor

index 04364536e693a83a31a0fc7d5d1b81f6bd1a13a4..63a5f9c1f17bd889c8a56fd52b15d0c9329da565 100644 (file)
@@ -33,7 +33,7 @@ M: updater-model (model-changed) tuck updates>> =
 
 TUPLE: switch-model < multi-model original switcher on ;
 M: switch-model model-changed 2dup switcher>> =
-   [ [ value>> ] dip over [ t >>on set-model ] [ nip f swap (>>on) ] if ]
+   [ [ value>> ] dip over [ t >>on set-model ] [ nip [ original>> ] keep f >>on model-changed ] if ]
    [ dup on>> [ 2drop ] [ [ value>> ] dip over [ set-model ] [ 2drop ] if ] if ] if ;
 : <switch> ( signal1 signal2 -- signal' ) swap [ 2array switch-model <multi-model> ] 2keep
    [ >>original ] [ >>switcher ] bi* ;