You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When initializing a ComposableController class, given a ComposableControllerState type:
A type error should be raised if the list of child controllers specified in the controllers array constructor option does not exactly match the list of controllers included in the ComposableControllerState type.
A type error should be raised if the controller-messenger instance passed into the messenger constructor option has an event allowlist that does not include all of the stateChange events for the list of controllers in the ComposableControllerState type.
@MajorLift Can you update the ticket to include the solutions you have tried for number 2 above and the roadblocks you hit so that others have that context?
Validating with a union type consisting of the child controllers allows controllers lists that are incomplete.
Validating with a tuple type consisting of the child controllers forces us to pass in a controllers list that matches the order of the tuple type, not just the contents.
Because the tuple type is likely to be derived from a union type, its order cannot necessarily be determined based on the order of controllers presented in the ComposableControllerState type.
messenger:
Given an event allowlist T, and U s.t. U <: T, TypeScript does not recognize that RestrictedControllerMessenger<..., U> <: RestrictedControllerMessenger<..., T>.
Wrap class constructor into a factory function that takes the event allowlist as a parameter, and validate that parameter?
Requirements
When initializing a
ComposableController
class, given aComposableControllerState
type:A type error should be raised if the list of child controllers specified in the
controllers
array constructor option does not exactly match the list of controllers included in theComposableControllerState
type.A type error should be raised if the controller-messenger instance passed into the
messenger
constructor option has an event allowlist that does not include all of thestateChange
events for the list of controllers in theComposableControllerState
type.References
The text was updated successfully, but these errors were encountered: