Giter VIP home page Giter VIP logo

Comments (5)

kolodny avatar kolodny commented on May 12, 2024

Nope, in both cases it swallows up the first execution of the function and only runs the second after the required time passes

from exercises.

kolodny avatar kolodny commented on May 12, 2024

Actually it appears that you are correct. It seems I mixed up throttle and denounce. I'll fix that when I get a chance

from exercises.

Ephem avatar Ephem commented on May 12, 2024

If this throttle-function is supposed to behave like the Underscore one it seems as if it should actually be called twice:

By default, throttle will execute the function as soon as you call it for the first time, and, if you call it again any number of times during the wait period, as soon as that period is over.

Not the clearest sentence, but if I understand it correctly this would mean that it's actually the Readme and the first tests that should be changed?

from exercises.

thedufer avatar thedufer commented on May 12, 2024

This doesn't look fixed. The first test case for throttle expects 3 calls in a row to result in a single execution, but _.throttle would call it twice - once on the leading edge, once on the trailing edge. It may be that you intended it to mimic _.throttle with either the leading: false or trailing: false options set, in which case the README should be updated as such.

from exercises.

kolodny avatar kolodny commented on May 12, 2024

I renamed it to debounce, I'll add a throttle exercise later

from exercises.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.