# remove method

ObjectHolder<Object>? remove(

1. String name

)

Remove the object with the given name from the underlying scope.

This method removes an object from the scope and executes any registered destruction callbacks. The removal behavior depends on the scope implementation:

- Singleton: removes and destroys the singleton
- Prototype: typically no-op as prototypes aren't cached
- Request/Session: removes from current context

`name`: The name of the object to remove Returns the removed object, or null if no object was found

Throws:

- IllegalArgumentException if name is null or empty
- `ScopeException` if the scope doesn't support removal

Example:

    // Remove an object from the scope
    final removed = scope.remove('temporaryService');
    if (removed != null) {
      print('Removed service: $removed');
    }

## Implementation

    ObjectHolder<Object>? remove(String name) => null;