Refactor ProtocolFactory for convenience to assign a type parameter for the value type #9316
Labels
area/test
Marks an issue as improving or extending the test coverage of the project
kind/toil
Categorizes an issue or PR as general maintenance, i.e. cleanup, refactoring, etc.
version:8.1.0-alpha2
version:8.1.0
Marks an issue as being completely or in parts released in 8.1.0
Description
It's possible to pass a builder to a generated record in order to customize it. However at the moment, it's always typed as
Record<RecordValue>
, which limits what we can do. It also means we often have to cast the result back if we want to access certain properties.To circumvent this, we can already use generics to obtain the type we expect. It's just as safe, in the sense that where the cast would have failed, it will still fail, so it's still up to the caller to ensure that things work properly.
The text was updated successfully, but these errors were encountered: