BlockValue.st
changeset 4242 dee79356dad2
parent 3946 3aa94b58d2b0
child 4257 2f858dbfd25b
equal deleted inserted replaced
4241:8c18cc3470d8 4242:dee79356dad2
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 1995 by Claus Gittinger
     4  COPYRIGHT (c) 1995 by Claus Gittinger
     3 	      All Rights Reserved
     5 	      All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
   478 ! !
   480 ! !
   479 
   481 
   480 !BlockValue methodsFor:'change & update'!
   482 !BlockValue methodsFor:'change & update'!
   481 
   483 
   482 recomputeValue
   484 recomputeValue
   483     "reevaluate my actionBlock, and possibly send a change notification to my dependents"
   485     "force reevaluation of my actionBlock, 
       
   486      and possibly send a change notification to my dependents"
   484 
   487 
   485     |oldValue|
   488     |oldValue|
   486 
   489 
   487     oldValue := cachedValue.
   490     oldValue := cachedValue.
   488     cachedValue := self computeValue.
   491     cachedValue := self computeValue.
   489     oldValue ~~ cachedValue ifTrue:[
   492     oldValue ~~ cachedValue ifTrue:[
   490         self changed:#value
   493         self changed:#value
   491     ].
   494     ].
       
   495 
       
   496     "Modified (comment): / 05-03-2019 / 21:40:21 / Claus Gittinger"
   492 !
   497 !
   493 
   498 
   494 update:something with:aParameter from:someone
   499 update:something with:aParameter from:someone
   495     "the one I depend on has changed - reevaluate my actionBlock,
   500     "the one I depend on has changed - reevaluate my actionBlock,
   496      and possibly send a change notification to my dependents"
   501      and possibly send a change notification to my dependents"