Skip to content

Instantly share code, notes, and snippets.

@nbarishok
Created April 4, 2016 20:59
Show Gist options
  • Save nbarishok/3fc3043b2d4b2f7bc7c48e221ed6ac3c to your computer and use it in GitHub Desktop.
Save nbarishok/3fc3043b2d4b2f7bc7c48e221ed6ac3c to your computer and use it in GitHub Desktop.
@Module
public class WeatherModule {
@Provides @PerFragment
GetWeatherInMoscowInteractor provideGetWeatherInterator(WeatherRepository repo) {
return new GetWeatherInMoscowUseCase(repo);
}
@Provides @PerFragment
WeatherMapper provideWeatherMapper() {
return new WeatherMapperImpl();
}
@Provides
@PerFragment
WeatherPresenter provideCommunicationBus(@Named("presenter") WeatherPresenter presenter) {
return new WeatherCommunicationBus(presenter);
}
@Provides
@Named("presenter")
@PerFragment
WeatherPresenter provideWeatherPresenter(GetWeatherInMoscowInteractor getWeather, WeatherMapper mapper) {
return new WeatherPresenterImpl(getWeather, mapper);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment