Skip to content

Add ability to unbind a specific class #1035

@manfred4

Description

@manfred4

I propose adding the ability to unbind a specific class from any previously bound interface.
If for example some project I depend on already binds the classes Katana and Shuriken to the interface Weapon, whereas I only want a multiinject to inject the Katana and other self-defined weapons and not shurikens, because they are just too sneaky.

Expected Behavior

I unbind the shuriken from the weapon interface and bind a new weapon.
When using multiinject on the Weapon class only the Katana and my new weapon should be in the injected objects.

Current Behavior

unbind unbinds all previously defined classes from the interface and only my new defined weapon would be in the multiinjected list.

Possible Solution

The project I depend on already binds like this:
bind(Katana).to(Weapon)
bind(Shuriken).to(Weapon)
Add some new syntax to allow this:
unbind(Shuriken).from(Weapon)
bind(Hammer).to(Weapon)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions