local z=require(script.Parent.Parent.lib.t)local Y=z.tuple(z.number,z.callback)local function Z(z,Z)assert(Y(z,Z))local a=true return function(...)if not a then return end a=false Z(...)wait(z)a=true end end return Z
local t = require(script.Parent.Parent.lib.t)

local debounceCheck = t.tuple(t.number, t.callback)

local function debounce(waitTime, callback)
	assert(debounceCheck(waitTime, callback))

	local isReady = true

	return function(...)
		if not isReady then return end

		isReady = false

		callback(...)
		wait(waitTime)

		isReady = true
	end
end

return debounce
