how to dequeue elements from a custom queue using shim
See original GitHub issueI’m currently using the shim and I’m not too sure if I’m dequeue a queue correctly.
I have an array of elements in which I loop through calling Velocity(element, propertiesMap, options) on each one. options
has a queue
property with a value of “itemQueue”. I then dequeue the elements by calling Velocity(elementsArray, propertiesMap, { queue: false }) which runs the animation as expected except that subsequent runs are getting longer and longer to start the animation.
I’m thinking that the queue is not being dequeued properly, but I can’t figure out how to do it with the shim syntax.
Thanks
Issue Analytics
- State:
- Created 9 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Implement Stack and Queue using Deque - GeeksforGeeks
Now, deque can be used to implement a stack and queue. ... displays the elements in deque. void display() ... pop to remove...
Read more >Custom Queue Implementation in Java - DevGlan
In this article, we will create a custom implementation of Queue ... deQueue(): Removes and returns the element at the front of the...
Read more >Creating a Queue in C | DigitalOcean
dequeue () : Removes the element from the frontal side of the queue; enqueue() : It inserts elements to the end of the...
Read more >Java Queue - Queue Methods, Queue Implementation ...
#2) Dequeue: The operation to delete an element from the queue is Dequeue (function queueDequeue in the program). First, we check whether the ......
Read more >Implement Efficient Queues Using Python's collections Module
Creating a Custom Queue Class Using deque · enQueue() will add elements to the queue · deQueue() will remove elements from the queue...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No, not really.
This is the code and maybe you can see what I’m doing wrong or a better way of doing it.
During initialization the UI sends an element, which usually represents a list of items. Every time I receive an element I push it onto my queue called elementQueue to be animated later. Below is the code snippet
Then after the UI has initialized I call my dequeueElements function
I loop through the elements to dequeue them, which seems to dequeue them properly. They appear but they do not get animated. I’ve tried different approaches with, like passing options.queue = “false”, varying results.
Sorry I’m going to add another variation, which I thought would work, but the items aren’t visible, but they are there.
then calling
Oh and itemsInPropMap === “transition.slideRightIn” and ItemsInOpts = { stagger: 175, drag: true }
OK. I figured out whats been happening.
I want to say up front that I stopped using the custom queues, which seem to work by the way, because it wasn’t what I needed. But thanks for the CodePen, it helped me understand what custom queues are for and how to use them properly.
Thanks 😃