# whenObjectRemoved

abstract fun whenObjectRemoved(action: Action<in T>): Action<in T>(source)

Adds an `Action` to be executed when an object is removed from this collection.

This method will only be invoked for elements effectively added to the collection. Elements that are addLater will be seen by this action only if they have been observed as part of the collection. All elements affected by this action will be realized.

#### Return

the supplied action

#### Since

0.7

#### Parameters

action

The action to be executed

abstract fun whenObjectRemoved(action: Closure)(source)

Adds a closure to be called when an object is removed from this collection. The removed object is passed to the closure as the parameter.

This method will only be invoked for elements effectively added to the collection. Elements that are addLater will be seen by this action only if they have been observed as part of the collection. All elements affected by this action will be realized.

#### Since

1.0

#### Parameters

action

The closure to be called