function DataStorePromises.updateAsync(x,e,P)assert(typeof(x)=="\073\110\115\116\097\110\099\101","\066\097\100 \114\111\098\108\111\120\068\097\116\097\083\116\111\114\101")assert(type(e)=="\115\116\114\105\110\103","\066\097\100 \107\101\121")assert(type(P)=="\102\117\110\099\116\105\111\110","\066\097\100 \117\112\100\097\116\101\070\117\110\099")return Promise.spawn(function(S,j)local s=nil local z,r=pcall(function()s={x:UpdateAsync(e,P)}end)if not z then return j(r)end if not s then return j("\078\111 \114\101\115\117\108\116 \108\111\097\100\101\100")end return S(unpack(s))end)end
--[=[
	Wraps :UpdateAsync() in a promise
	@param robloxDataStore DataStore
	@param key string
	@param updateFunc (T) -> T?
	@return Promise<boolean>
]=]

function DataStorePromises.updateAsync(robloxDataStore, key, updateFunc)
	assert(typeof(robloxDataStore) == "Instance", "Bad robloxDataStore")
	assert(type(key) == "string", "Bad key")
	assert(type(updateFunc) == "function", "Bad updateFunc")

	return Promise.spawn(function(resolve, reject)
		local result = nil
		local ok, err = pcall(function()
			result = { robloxDataStore:UpdateAsync(key, updateFunc) }
		end)
		if not ok then
			return reject(err)
		end
		if not result then
			return reject("No result loaded")
		end
		return resolve(unpack(result))
	end)
end
