-
-
Notifications
You must be signed in to change notification settings - Fork 681
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
Allow message_progress_bar to be a function #3201
Conversation
🦋 Changeset detectedLatest commit: 4cb77e8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Thanks @Shaobin-Jiang! This seems useful to me. @jspsych/core what do you think about having |
I personally think |
I tend to agree with @Shaobin-Jiang. Also, supporting both really doesn't add much complexity implementation-wise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added some review comments – @Shaobin-Jiang let me know if you'd like to address them or if I should quickly do the changes. Also, the function parameter is lacking a unit test 🙃
- adding a private `updateMessage` method - using a simpler version of checking function type
Unit test is added as requested @bjoluc |
I have encountered this situation many times when I want to update the progress bar message when the progress bar updates, but the only way of doing it before is manually changing the
innerHTML
in anon_finish
function of a trial. Therefore, I think we should allow users to setmessage_progress_bar
as a function that returns the progress, so that the message gets updated automatically.For example: