function DataStore.Debug(q,...)if q.debug then print(...)end end function DataStore._GetRaw(q)if q.getRawPromise then return q.getRawPromise end q.getRawPromise=((q.savingMethod:Get()):andThen(function(U)q.value=U q:Debug("\118\097\108\117\101 \114\101\099\101\105\118\101\100")q.haveValue=true end)):finally(function()q.getting=false end)return q.getRawPromise end function DataStore._Update(U,q)if not q then for q,j in pairs(U.callbacks)do j(U.value,U)end end U.haveValue=true U.valueUpdated=true end
--Internal functions
function DataStore:Debug(...)
	if self.debug then
		print(...)
	end
end

function DataStore:_GetRaw()
	if self.getRawPromise then
		return self.getRawPromise
	end

	self.getRawPromise = self.savingMethod
		:Get()
		:andThen(function(value)
			self.value = value
			self:Debug("value received")
			self.haveValue = true
		end)
		:finally(function()
			self.getting = false
		end)

	return self.getRawPromise
end

function DataStore:_Update(dontCallOnUpdate)
	if not dontCallOnUpdate then
		for _, callback in pairs(self.callbacks) do
			callback(self.value, self)
		end
	end

	self.haveValue = true
	self.valueUpdated = true
end
