mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
refactor(init): set cache[key] after triggering onCache
Allow for comparison of new and old values by checking cache[key] against the value sent as an argument.
This commit is contained in:
4
init.lua
4
init.lua
@@ -188,11 +188,11 @@ end)
|
|||||||
|
|
||||||
AddEventHandler('ox_lib:updateCache', function(data)
|
AddEventHandler('ox_lib:updateCache', function(data)
|
||||||
for key, value in pairs(data) do
|
for key, value in pairs(data) do
|
||||||
cache[key] = value
|
|
||||||
|
|
||||||
if lib.onCache[key] then
|
if lib.onCache[key] then
|
||||||
lib.onCache[key](value)
|
lib.onCache[key](value)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
cache[key] = value
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user