Last active
August 16, 2018 08:11
-
-
Save bmelnychuk/e4f9274f775abaad0d05ec74e6dad4f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GetNextQuestion { | |
questionRepository: QuestionRepository; | |
nextQuestionPolicy: NextQuestionPolicy; | |
async invoke(categoryId: string): Promise<Question> { | |
const availableQuestions = await this.questionRepository.getAvailableQuestions( | |
categoryId | |
); | |
return this.nextQuestionPolicy.getNextQuestion(availableQuestions); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment