--[[
	Get the current value from a binding
]]

function bindingPrototype:getValue()
	local internalData = self[InternalData]

	--[[
		If our source is another binding but we're not subscribed, we'll
		return the mapped value from our upstream binding.

		This allows us to avoid subscribing to our source until someone
		has subscribed to us, and avoid creating dangling connections.
	]]
	if internalData.upstreamBinding ~= nil and internalData.upstreamDisconnect == nil then
		return internalData.valueTransform(internalData.upstreamBinding:getValue())
	end

	return internalData.value
end
