Skip to content

Feature/group mapping#7

Open
ivan-shaban wants to merge 2 commits intorobotlegs:masterfrom
ivan-shaban:feature/group_mapping
Open

Feature/group mapping#7
ivan-shaban wants to merge 2 commits intorobotlegs:masterfrom
ivan-shaban:feature/group_mapping

Conversation

@ivan-shaban
Copy link

Add group mappings, to easy remove several mapping with some common sense. Also introduce IInjectionMapping interface to hide inner method from public API.
Example:

var groupName : String = "test";
injector.map(Interface, "value").toValue(new Clazz()).toGroup(groupName);
injector.map(Interface, "singleton").toSingleton(Clazz).toGroup(groupName);
injector.map(Interface).toSingleton(Clazz);

.... and then just :

injector.unmapGroup(groupName);

All mapping that hasn't groupName still exist, but those who has already unmaped. IMHO that more handly that creating new context with all environment.

@ivan-shaban
Copy link
Author

Hi, can you add any comments to this request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant