I’ll take a look, but this change likely breaks its ability to immediately respond to threshold changes e.g. second to minute.
I also wouldn’t expect the setDate to change unless the time has actually passed by more than a second since it goes to the start of the threshold.
Again, I haven’t confirmed this yet, but that’s my intuition.
EDIT: I have confirmed the tests pass without your changes. The break may be caused by your added functionality
You can pull the tests down from useDateTime Code Sandbox with Testsin a new Create React App with "export to zip" to confirm (Code Sandbox doesn't seem to play well with @jest/globals, and export to Zip wasn't working for me either).
I've included a test that I believe will fail with your change, but you can confirm that for your implementation.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I’ll take a look, but this change likely breaks its ability to immediately respond to threshold changes e.g. second to minute.
I also wouldn’t expect the setDate to change unless the time has actually passed by more than a second since it goes to the start of the threshold.
Again, I haven’t confirmed this yet, but that’s my intuition.EDIT: I have confirmed the tests pass without your changes. The break may be caused by your added functionality
You can pull the tests down from useDateTime Code Sandbox with Tests
in a new Create React Appwith "export to zip" to confirm (Code Sandbox doesn't seem to play well with@jest/globals
, andexport to Zip wasn't working for me either).I've included a test that I believe will fail with your change, but you can confirm that for your implementation.