function DataStore.Debug(P,...)if P.debug then end end function DataStore._GetRaw(P)if P.getRawPromise then return P.getRawPromise end P.getRawPromise=((P.savingMethod:Get()):andThen(function(G)P.value=G P:Debug("\118\097\108\117\101 \114\101\099\101\105\118\101\100")P.haveValue=true P.getting=false end)):catch(function(G)P.getting=false P.getRawPromise=nil return Promise.reject(G)end)return P.getRawPromise end function DataStore._Update(G,P)if not P then for P,w in ipairs(G.callbacks)do w(G.value,G)end end G.haveValue=true G.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
