Skip to content

Instantly share code, notes, and snippets.

@bmelnychuk
Last active August 16, 2018 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bmelnychuk/e4f9274f775abaad0d05ec74e6dad4f6 to your computer and use it in GitHub Desktop.
Save bmelnychuk/e4f9274f775abaad0d05ec74e6dad4f6 to your computer and use it in GitHub Desktop.
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