Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add onCancel option to quizzes #316

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vherrmann
Copy link
Contributor

@vherrmann vherrmann commented May 21, 2024

With this pr I want to add the callback onCancel to the options of quiz objects. This callback is executed whenever the quiz is cancelled. I gave it the same type as onComplete:

  onCancel?: (summary: { character: string; totalMistakes: number }) => void;

All tests have passed on my machine.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.42%. Comparing base (4ec4eda) to head (3de527f).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #316      +/-   ##
==========================================
+ Coverage   96.41%   96.42%   +0.01%     
==========================================
  Files          32       32              
  Lines        1144     1148       +4     
  Branches      212      213       +1     
==========================================
+ Hits         1103     1107       +4     
  Misses         37       37              
  Partials        4        4              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vherrmann
Copy link
Contributor Author

vherrmann commented May 21, 2024

I have just noticed that the even though quiz.cancel() is executed on animateCharacter it is not on e.g. showCharacter. Therefore this pr may not be that reasonable after all (since the feature would work in unexpected ways).

@vherrmann vherrmann marked this pull request as draft May 21, 2024 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants