mirror of
https://github.com/Ukendio/jecs.git
synced 2026-03-18 00:44:32 +00:00
26 lines
No EOL
514 B
Text
26 lines
No EOL
514 B
Text
local RunService = game:GetService("RunService")
|
|
|
|
local vide = require(script.Parent.Parent.Parent.vide)
|
|
|
|
local source = vide.source
|
|
local effect = vide.effect
|
|
local cleanup = vide.cleanup
|
|
|
|
return function<T>(delay: number, input: () -> T): () -> T
|
|
local output = source(input())
|
|
|
|
effect(function()
|
|
local v = input()
|
|
local t = delay
|
|
|
|
cleanup(RunService.Heartbeat:Connect(function(dt)
|
|
t -= dt
|
|
if t > 0 then return end
|
|
output(v)
|
|
|
|
end))
|
|
|
|
end)
|
|
|
|
return output
|
|
end |