Skip to content

Feature/group mapping#3

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

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

Conversation

@ivan-shaban
Copy link
Copy Markdown

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.

@vaukalak
Copy link
Copy Markdown

vaukalak commented Jun 5, 2014

+1

@darscan
Copy link
Copy Markdown
Owner

darscan commented Jun 5, 2014

Please open pull requests here: https://github.com/robotlegs/swiftsuspenders

@ivan-shaban
Copy link
Copy Markdown
Author

Hi, thanks, have move pull request there,

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.

3 participants