Skip to content

Instantly share code, notes, and snippets.

@doridori
Created March 31, 2017 12:53
Show Gist options
  • Save doridori/3873b8f8a11b98fcf62e89d7f22825f3 to your computer and use it in GitHub Desktop.
Save doridori/3873b8f8a11b98fcf62e89d7f22825f3 to your computer and use it in GitHub Desktop.
Example of a Dagger wrapped pilot stack for Activity/Stack scoped DI.
/**
* A PilotStack that also holds a ref to a Dagger Component. This is useful for easy Activity-Scoped DI as the PilotStack has to already live
* on past the host-Activities config-change events by some mechanism (project dependent).
*
* @param <D> A Dagger Component to supply all deps for this stacks frames.
*/
//todo unused - here for dagger activity scope refactor (See trello)
public class DaggerPilotStack<D> extends PilotStack
{
D scopedDaggerComponent;
public DaggerPilotStack(PilotFrameFactory pilotFrameFactory, D scopedDaggerComponent)
{
super(pilotFrameFactory);
this.scopedDaggerComponent = scopedDaggerComponent;
}
public D getScopedDaggerComponent()
{
return scopedDaggerComponent;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment