CollectionValueHolder additions
Hi, when (any) ValueHolder changes, a ValueChanged announcement is fired. My question: Would it be a good idea to add ValueAdded and ValueRemoved for CollectionValueHolder? Otherwise there's no way to meaningfully observe changes. -- Peter
Hi peter Do you mean instead of having ValueChanged? What would be scenario for ValueRemoved? Stef Le 8/12/15 01:01, Peter Uhnak a écrit :
Hi,
when (any) ValueHolder changes, a ValueChanged announcement is fired.
My question: Would it be a good idea to add ValueAdded and ValueRemoved for CollectionValueHolder?
Otherwise there's no way to meaningfully observe changes.
On 12/08, stepharo wrote:
Hi peter
Do you mean instead of having ValueChanged? What would be scenario for ValueRemoved?
In addition to ValueChanged. col := OrderedCollection new asValueHolder. col add: 1. "ValueAdded with 1 announced" col remove: 1. "ValueRemoved with 1 announced" of course in both cases ValueChanged would be fired as normal. But for collections from ValueChanged I can't tell what has been changed.
Stef
Le 8/12/15 01:01, Peter Uhnak a écrit :
Hi,
when (any) ValueHolder changes, a ValueChanged announcement is fired.
My question: Would it be a good idea to add ValueAdded and ValueRemoved for CollectionValueHolder?
Otherwise there's no way to meaningfully observe changes.
-- Peter
Hi Peter, why don't you send the changed indexes as well? Just the value doesn't bring much imho. A single event could do all (ValueChangedFromToWith : hold all the information from a copyReplaceFrom:to:with: since I think this is a 'can do everything with it' kind of api: delete, replace, add). Thierry 2015-12-08 11:44 GMT+01:00 Peter Uhnak <i.uhnak@gmail.com>:
On 12/08, stepharo wrote:
Hi peter
Do you mean instead of having ValueChanged? What would be scenario for ValueRemoved?
In addition to ValueChanged.
col := OrderedCollection new asValueHolder.
col add: 1. "ValueAdded with 1 announced" col remove: 1. "ValueRemoved with 1 announced"
of course in both cases ValueChanged would be fired as normal. But for collections from ValueChanged I can't tell what has been changed.
Stef
Le 8/12/15 01:01, Peter Uhnak a écrit :
Hi,
when (any) ValueHolder changes, a ValueChanged announcement is fired.
My question: Would it be a good idea to add ValueAdded and ValueRemoved for CollectionValueHolder?
Otherwise there's no way to meaningfully observe changes.
-- Peter
participants (3)
-
Peter Uhnak -
stepharo -
Thierry Goubier