Community Feedback on cache

serverid in cache is pointless and will never change

unit tests are not actually unit tests so i renamed to examples.
This commit is contained in:
Mr.Crowley committed 2025-08-18 18:32:38 -05:00
1 parent fd28d9a1a6
commit cdeba0652d
8 files changed
+9 -28

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
AddEventHandler('onResourceStart', function(resource)
if resource == GetCurrentResourceName() then
Bridge.Cache.OnChange("Ped", function(newValue, oldValue)
print("Ped changed from " .. tostring(oldValue) .. " to " .. tostring(newValue))
end)
end
end)
RegisterCommand("testcache", function(source, args, rawCommand)
-- local cache = Bridge.Cache.Get("Ped")
Bridge.Cache.Create("TestCache", function()
return math.random(1, 100)
end, 1000)
Bridge.Cache.OnChange("TestCache", function(newValue, oldValue)
print("TestCache changed from " .. tostring(oldValue) .. " to " .. tostring(newValue))
end)
end)