]> gitweb.factorcode.org Git - factor.git/commitdiff
|-products work correctly
authorSam Anklesaria <sam@Tintin.local>
Sun, 24 May 2009 15:05:17 +0000 (10:05 -0500)
committerSam Anklesaria <sam@Tintin.local>
Sun, 24 May 2009 15:05:17 +0000 (10:05 -0500)
extra/ui/frp/signals/signals.factor

index 461b8f07326c9b4e15db6ab7a703767076be2139..184dd05365ccbe04ff33f91b520a2bb80197e1d1 100644 (file)
@@ -66,16 +66,18 @@ M: action (model-changed) [ [ value>> ] [ quot>> ] bi* call( a -- b ) ] keep val
 
 TUPLE: | < multi-model ;
 : <|> ( models -- product ) | <multi-model> ;
+GENERIC: models-changed ( product -- )
+M: | models-changed drop ;
 M: | model-changed
     nip
     dup dependencies>> [ value>> ] all?
-    [ dup [ value>> ] product-value >>value notify-connections
-    [ drop ] if ;
+    [ [ dup [ value>> ] product-value >>value notify-connections ] keep models-changed ]
+    [ drop ] if ;
 M: | update-model
     dup value>> swap [ set-model ] set-product-value ;
 M: | model-activated dup model-changed ;
 
+! Only when everything's true does he make it false
 TUPLE: & < | ;
 : <&> ( models -- product ) & <multi-model> ;
-M: & model-changed [ call-next-method ] keep
-   [ dependencies>> [ f swap set-model ] each ] with-locked-model ;
\ No newline at end of file
+M: & models-changed dependencies>> [ f swap (>>value) ] each ;
\ No newline at end of file