aboutsummaryrefslogblamecommitdiff
path: root/src/background/usecases/FindUseCase.js
blob: 224e4a939eb8c08f4c39e316163d12a62b0e7360 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                            
                                                             
 
                                  
                 
                                           
                                               
                                             







                                                   



                                                   
 
import FindRepository from '../repositories/FindRepository';
import TabPresenter from '../presenters/TabPresenter';
import ConsoleClient from '../infrastructures/ConsoleClient';

export default class FindUseCase {
  constructor() {
    this.tabPresenter = new TabPresenter();
    this.findRepository = new FindRepository();
    this.consoleClient = new ConsoleClient();
  }

  getKeyword() {
    return this.findRepository.getKeyword();
  }

  setKeyword(keyword) {
    return this.findRepository.setKeyword(keyword);
  }

  async findStart() {
    let tab = await this.tabPresenter.getCurrent();
    return this.consoleClient.showFind(tab.id);
  }
}