{"id":"sap0bombado/create-throttle","name":"create-throttle","scope":"sap0bombado","platform":"roblox","description":"Mirrored from the Wally registry.","version":"0.2.0","latest":"0.2.0","versions":["0.1.0","0.2.0"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{},"integrity":"c7c197d3061103119957d59ef37aebc079000413cd2b380f773c9a6789c06c55","likes":0,"downloads":0,"install":"forest install sap0bombado/create-throttle","url":"https://forest.dev/p/roblox/sap0bombado/create-throttle","files":"https://api.forest.dev/ai/package/roblox/sap0bombado/create-throttle/files","readme":"## Basic Usage\r\n```luau\r\n--!strict\r\nlocal createThrottle = require(\"@pkg/createThrottle\")\r\n\r\n-- Create a throttle with a 2-second interval\r\nlocal throttle = createThrottle(2, os.clock)\r\n\r\n-- Example event loop\r\nwhile true do\r\n\ttask.wait(0.2)\r\n\r\n\t-- Call throttle like a function to check if it's allowed\r\n\tif throttle() == true then\r\n\t\tprint(\"Action allowed at:\", os.clock())\r\n\telse\r\n\t\tprint(\"Blocked by throttle\")\r\n\tend\r\nend\r\n\r\n-- Changing interval dynamically\r\ntask.delay(3, function()\r\n\tthrottle(0.5) -- make it faster after 10 seconds\r\n\tprint(\"Throttle interval changed to 0.5s\")\r\nend)\r\n```\r\n\r\n## Install\r\nAdd as a Wally dependency:\r\n```toml\r\ncreateThrottle = \"sap0bombado/create-throttle@0.1.0\"\r\n```","readmeTruncated":false}