Ad
  • Custom User Avatar

    It's not allowed to do a break before the returned function is called.

    Better?

  • Custom User Avatar

    There is always work to do (it's called at least once).
    I like to avoid that you do a break without working.

  • Custom User Avatar

    Thx Kacarott,
    I checked your results and updated the tests and description to avoid this solution:
    https://www.codewars.com/kata/reviews/60a24cfbf2b4d60001148fe2/groups/60a3518d3238e20001424f96

    This should not be possible, but I understand why you did this 👍.

    Added:

    It's not possible that you don't have any work to do.

    generateTest(50, [200]);

  • Custom User Avatar

    :), I'm happy with the result of my first kata.
    Now I know what to expect next time.
    I hope it won't be similar to Implement Debounce which is open for 4 years.

  • Custom User Avatar

    I added this part:

    Running tests require 6-10 seconds to complete, depending on the timeouts of the random tests.

    Alright, I hope they will update their votes soon. Wouldn't it make sense to reset the rating after big changes?

  • Custom User Avatar

    Tests are refactored and random tests are added.
    Wdyt?
    Thx for your feedback, it's very helpful.

  • Custom User Avatar

    Yes, updated 🙈

  • Custom User Avatar

    Can you check again?

  • Custom User Avatar

    Thank you, looks like I forgot to remove async (had a different version before).
    Anyway, I go for promise based tests.

  • Custom User Avatar

    The break doesn't have a duration (you have a break until the next work is requested).
    I added this:

    Your break is over when the next work is requested.

  • Custom User Avatar

    I changed the task (the solution is very similar).
    What do you think?

  • Custom User Avatar

    You could say that this is a simpler version of that kata.
    I will rewrite the task description. Thank you for your feedback 👍.

  • Custom User Avatar

    In the other kata:

    The delaying of the execution of the function until the end of the delay interval is referred to as executing the function on the trailing edge of the interval. This should be the default behavior of debounce. However, you should also be able to pass an optional third parameter, immediate, which, if truthy, will signify that the user wants the function to be executed on the leading edge of the interval:

  • Custom User Avatar

    You are right, it's very similar. I saw that one after I created this kata.
    Still, it's different because of the immediate argument.