# 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

#### 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.

#### Parameters

action

The closure to be called