3.5.0 • Published 1 year ago

@quenty/cancellabledelay v3.5.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

cancellableDelay

cancellableDelay a delay that can be cancelled

Installation

npm install @quenty/cancellabledelay --save

Usage

Usage is pretty simple, it's a delay function that returns.

local cancel = cancellableDelay(2, function(arg)
    print("Executing", arg)
end, 5)

delay(1, function()
    cancel() -- cancel
end)