Prefer init over add, mark add as deprecated

This commit is contained in:
NullBite 2023-06-23 02:37:49 -04:00
parent 74671b21c5
commit 7e953ca00b
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A

View File

@ -129,12 +129,12 @@ end
---@param key string key name ---@param key string key name
---@param value any initial value ---@param value any initial value
---@param callback? function Callback function to run on value change ---@param callback? function Callback function to run on value change
function sharedstate.add(key, value, callback) function sharedstate.init(key, value, callback)
logging.trace("sharedstate.add", key, value, callback) logging.trace("sharedstate.init", key, value, callback)
set_value(key, value, callback) set_value(key, value, callback)
end end
-- alias so i can decide what feels better ---@deprecated use sharedstate.init instead
sharedstate.init=sharedstate.add sharedstate.add=sharedstate.init
--- Internal; transfer value over network --- Internal; transfer value over network
---Ping used to transfer a value over the network, should not be called ---Ping used to transfer a value over the network, should not be called