--[=[
	Observes a link value that is not nil.

	@param linkName string
	@param parent Instance
	@return Brio<Instance>
]=]

function RxLinkUtils.observeLinkValueBrio(linkName, parent)
	assert(type(linkName) == "string", "linkName should be 'string'")
	assert(typeof(parent) == "Instance", "parent should be 'Instance'")

	return RxInstanceUtils.observeChildrenOfNameBrio(parent, "ObjectValue", linkName)
		:Pipe({
			RxBrioUtils.flatMapBrio(function(instance)
				return RxInstanceUtils.observePropertyBrio(instance, "Value", function(value)
					return value ~= nil
				end)
			end)
		})
end
