This is a post I’ve been wanting to write for some time. We had to implement a client side queue in two of our apps recently using Vue 3 and Vuex 4.
Now why would you want a client side queue? Well with so much more power given to the web browsers, there are actually times where you might want to perform a long running task in the browser. For example, with FFMPEG WASM you can actually encode videos directly the browser itself, WITHOUT touching a server! For these scenarios, building a queue is the perfect system to make this work.
Since these are still kind of “fringe” scenarios, I wasn’t going to go to the trouble right away by making an officially supported package. However, using Vuex with the reactivity of Vue 3, you can make a simple queue system fairly simply. Let’s get started!