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

Parent definition with before/after injections #458

Closed
Emailrus opened this issue Dec 1, 2015 · 3 comments
Closed

Parent definition with before/after injections #458

Emailrus opened this issue Dec 1, 2015 · 3 comments

Comments

@Emailrus
Copy link
Contributor

Emailrus commented Dec 1, 2015

Not sure if it's by design, but it seems that TyphoonDefinition+InstanceBuilder doesn't take into account beforeInjections and afterInjections of parent definitions.

I wanted to have something like this:

- (id<IViewModel>)parentViewModel
{
    return [TyphoonDefinition withClass:[BaseViewModel class]
                          configuration:^(TyphoonDefinition *definition)
    {
        definition.abstract = YES;
        [definition performAfterInjections:@selector(myAfterInjectionMethod)];
    }];
}

- (id <IProfileViewModel>)profileViewModel
{
    return [TyphoonDefinition withParent:[self parentViewModel]
                                   class:[ProfileViewModel class]];
}

But myAfterInjectionMethod is never called

@etolstoy
Copy link
Contributor

etolstoy commented Dec 2, 2015

@Emailrus, the wiki says:

From its parent, a definition will inherit the initializer, property injections, method injections and scope. Any of these can be overridden.

So, its by design. However, I'm not very familiar with this piece of functionality, so we need @jasperblues and @alexgarbarev to debate about this feature request.

@jasperblues
Copy link
Member

👍 I think it is an oversight that berfore/after injections are not inherited from the parent.

@alexgarbarev
Copy link
Contributor

👍

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

No branches or pull requests

4 participants