-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add syntactic sugar for mapping a class to itself #2
Comments
Can't you just do this: |
Ummm... Do you mean that is how it already works? Or as a suggestion of how it could work? |
It does break the symmetry, no? And it's not really clear either. |
I believe that's how it currently works. I'm not fond of it myself. |
Ok, I'll test it out. Would you agree on adding |
Sounds good to me :) |
That's exactly how it already works. But I agree: adding |
🤘 |
wades in is there something better than: asType() ? 'asType' always bothered me - because when do you map something not as a type? So it kind of means "not special", which is a very icky bit of venn diagram labelling. IIRC, it means newInstanceEachTimeFreshlyConstructedByTheAppropriateInjector() ... which obviously sucks, but perhaps there is something both pithy and less opaque than 'asType'? Sx On 8 Aug 2013, at 13:00, creynders notifications@github.com wrote:
|
@Stray Yeez. Unfortunately you're quite right. |
|
|
@tschneidereit I just took a quick look and was wondering why exactly it's done like this in the _defaultProviderSet = true;
mapProvider(new ClassProvider(type)); Seems a bit wasteful to have a |
@tschneidereit https://github.com/tschneidereit I just took a quick look
I went back and forth on this quite a bit. In the end, I decided that I'd Another consideration is that, without setting a default, it's pretty easy @darscan was talking about the ability to "finish" an injector, making it |
ATM if you want to map a class to be instantiated afresh each time you need to do:
Maybe it would be a good idea to add this to the API:
It's in symmetry with
@darscan What ya think?
The text was updated successfully, but these errors were encountered: