-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Closed
Labels
Feature:StateManagementimpact:lowAddressing this issue will have a low level of impact on the quality/strength of our product.Addressing this issue will have a low level of impact on the quality/strength of our product.loe:smallSmall Level of EffortSmall Level of Efforttechnical debtImprovement of the software architecture and operational architectureImprovement of the software architecture and operational architecture
Description
Currently when creating state container, transition and selectors allow to have state shape mismatch and typescript doesn't complain:
createStateContainer(
{ test: "string" },
{
transition: (state: {otherShape: string}) => () => state
}
);
Also have to specify state for each transition / selector explicitly, typescript doesn't infer it:
createStateContainer(
{ test: "string" },
{
transition: (state) => () => state // state is considered any here
}
);
Where, if possible, it should be:
createStateContainer(
{ test: "hello" },
{
transition: (state) => () => state // typescript understands that state is {test: "string"} here and doesn't allows to assign anything else
}
);
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Feature:StateManagementimpact:lowAddressing this issue will have a low level of impact on the quality/strength of our product.Addressing this issue will have a low level of impact on the quality/strength of our product.loe:smallSmall Level of EffortSmall Level of Efforttechnical debtImprovement of the software architecture and operational architectureImprovement of the software architecture and operational architecture