package com.zouag.contacts.screens.contactlist.di;

import com.zouag.contacts.screens.contactlist.ContactListContract;
import com.zouag.contacts.screens.contactlist.ContactListPresenter;
import com.zouag.contacts.data.ContactRepository;

import dagger.Module;
import dagger.Provides;

@Module
public class ContactListPresenterModule {
    private ContactListContract.View mView;

    public ContactListPresenterModule(ContactListContract.View view) {
        this.mView = view;
    }

    @Provides
    public ContactListContract.View provideView() {
        return mView;
    }

    @Provides
    public ContactListContract.Presenter providePresenter(
            ContactRepository contactRepository, ContactListContract.View view) {
        return new ContactListPresenter(contactRepository, view);
    }
}
