Closed
Description
Explanation
Currently, the allow lists of ComposableControllerMessenger
are set to string
, which is too permissive. Each ComposableController
instance needs typing and allow lists that are specific to its set of input child controllers.
However, there's no simple way to achieve this using BaseController
, as controller-messenger allow lists are defined for the controller class singleton, not controller instances.
Instead, ComposableController
and ComposableControllerMessenger
need to be made polymorphic upon the controllers
constructor property, which represents the list of child controllers to be composed.
Requirements
- A generic parameter
ControllerList
(or maybeChildControllers
) needs to be added to theComposableController
class andComposableControllerMessenger
type. ControllerList
should be constrained, but not defined by the least supertype for all base-controller instances (currentlyControllerInstance
).ControllerList
should be used to derive the return type offlatState()
at the type level.ControllerList
should be used to derive the state type forComposableController
instances.ControllerList
should be used to derive the allow lists ofComposableControllerMessenger
.- The allow lists should at minimum include the
stateChange
events for all child controllers that are subscribed to in the#updateChildController()
method.
- The allow lists should at minimum include the