|-products work correctly
parent
27b745dcc8
commit
22c071778a
|
@ -66,16 +66,18 @@ M: action (model-changed) [ [ value>> ] [ quot>> ] bi* call( a -- b ) ] keep val
|
||||||
|
|
||||||
TUPLE: | < multi-model ;
|
TUPLE: | < multi-model ;
|
||||||
: <|> ( models -- product ) | <multi-model> ;
|
: <|> ( models -- product ) | <multi-model> ;
|
||||||
|
GENERIC: models-changed ( product -- )
|
||||||
|
M: | models-changed drop ;
|
||||||
M: | model-changed
|
M: | model-changed
|
||||||
nip
|
nip
|
||||||
dup dependencies>> [ value>> ] all?
|
dup dependencies>> [ value>> ] all?
|
||||||
[ dup [ value>> ] product-value >>value notify-connections
|
[ [ dup [ value>> ] product-value >>value notify-connections ] keep models-changed ]
|
||||||
] [ drop ] if ;
|
[ drop ] if ;
|
||||||
M: | update-model
|
M: | update-model
|
||||||
dup value>> swap [ set-model ] set-product-value ;
|
dup value>> swap [ set-model ] set-product-value ;
|
||||||
M: | model-activated dup model-changed ;
|
M: | model-activated dup model-changed ;
|
||||||
|
|
||||||
|
! Only when everything's true does he make it false
|
||||||
TUPLE: & < | ;
|
TUPLE: & < | ;
|
||||||
: <&> ( models -- product ) & <multi-model> ;
|
: <&> ( models -- product ) & <multi-model> ;
|
||||||
M: & model-changed [ call-next-method ] keep
|
M: & models-changed dependencies>> [ f swap (>>value) ] each ;
|
||||||
[ dependencies>> [ f swap set-model ] each ] with-locked-model ;
|
|
Loading…
Reference in New Issue