I think RxJS should perfectly fit to supress dublicate button clicks for 2 seconds. However, Im struggleing with the implementation.
var $button = $('#myButton').button();
$button
.toObservable("click")
//.Throttle(2000) // Wouldn't fire the first event instantly :-(
.Subscribe(function(){ alert('clicked'); });
I already created a jsFiddle for your convenience. You need to scroll down in this fiddle, because I just pasted Rx inside as I couldn't find a CDN.
bufferWithTimeOrCount(2000, 1)
– Nansen