--[[
	Since Roact yields between render and didMount, a Dev Module user can, in theory, update the
	configuration values between the two lifecycle methods, resulting in a race condition.

	We need to make sure the event is connected before the yield happens, therefore we connect to this
	event in two locations:
	1. init(), and
	2. didMount()

	#2 is added to ensure that this event gets connected in the event that a user unmounts ConfigurationContext
	and mounts it again, which is extremely unlikely.
]]

function ConfigurationProvider:_connectUpdateEvent()
	if self.changedConn then
		return
	end

	self.changedConn = self.props.config.changed.Event:Connect(function(values)
		self:setState(values)
	end)
end
