function DataStore.Debug(l,...)if l.debug then print("\091\068\097\116\097\083\116\111\114\101\050\046\068\101\098\117\103\093",...)end end function DataStore._GetRaw(l)if l.getRawPromise then return l.getRawPromise end l.getRawPromise=((l.savingMethod:Get()):andThen(function(b)l.value=b l:Debug("\118\097\108\117\101 \114\101\099\101\105\118\101\100")l.haveValue=true l.getting=false end)):catch(function(b)l.getting=false l.getRawPromise=nil return Promise.reject(b)end)return l.getRawPromise end function DataStore._Update(b,l)if not l then for l,A in ipairs(b.callbacks)do A(b.value,b)end end b.haveValue=true b.valueUpdated=true end

function DataStore:Debug(...)
	if self.debug then
		print("[DataStore2.Debug]", ...)
	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
		self.getting = false
	end):catch(function(reason)
		self.getting = false
		self.getRawPromise = nil
		return Promise.reject(reason)
	end)

	return self.getRawPromise
end

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

	self.haveValue = true
	self.valueUpdated = true
end
