Skip to content

"The uses of jQuery .queue and .dequeue()" cites outdated jQuery source code #289

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

Closed
alimony opened this issue Mar 3, 2013 · 2 comments
Closed

Comments

@alimony
Copy link

alimony commented Mar 3, 2013

http://learn.jquery.com/effects/uses-of-queue-and-dequeue/

The second paragraph refers to the .delay implementation in the jQuery source code, but the code section is outdated, since the current implementation looks like this:

// Based off of the plugin by Clint Helfers, with permission.
// http://blindsignals.com/index.php/2009/07/jquery-delay/
delay: function( time, type ) {
    time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
    type = type || "fx";

    return this.queue( type, function( next, hooks ) {
        var timeout = setTimeout( next, time );
        hooks.stop = function() {
            clearTimeout( timeout );
        };
    });
}

It's probably not a good idea to have an example based on source code that's going to change over time, but could a temporary solution be to replace the code section with an updated version of the implementation?

@scottgonzalez
Copy link
Member

We should probably just dumb down the implementation and create one that doesn't support changing the type. It will make the code smaller and easier to follow, as well as get us away from having to track against the implementation in core. We can explain queue types later in the article.

@arthurvr
Copy link
Member

It's probably not a good idea to have an example based on source code that's going to change over time, but could a temporary solution be to replace the code section with an updated version of the implementation?

We should probably just dumb down the implementation and create one that doesn't support changing the type.

We kind of have a similar function in queue-and-dequeue-explained.md, so that will get done by #77. I'll open a PR updating the function as it is right now, we can simplify the implementation with the other issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants