Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/group mapping #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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.

@vaukalak
Copy link

vaukalak commented Jun 5, 2014

+1

@darscan
Copy link
Owner

darscan commented Jun 5, 2014

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

@ivan-shaban
Copy link
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