mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-11-27 21:04:45 +00: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:
1 parent
e971778b29
commit
62e4fea5ad
1 file changed
+2
-2
@@ -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