Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor ProtocolFactory for convenience to assign a type parameter for the value type #9316

Closed
Tracked by #8609
npepinpe opened this issue May 6, 2022 · 0 comments · Fixed by #9323
Closed
Tracked by #8609
Assignees
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

Comments

@npepinpe
Copy link
Member

npepinpe commented May 6, 2022

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.

@npepinpe npepinpe changed the title Refactor <code class="notranslate">ProtocolFactory` for convenience to assign a type parameter for the value type. Refactor ProtocolFactory for convenience to assign a type parameter for the value type. May 6, 2022
@npepinpe npepinpe changed the title Refactor ProtocolFactory for convenience to assign a type parameter for the value type. Refactor ProtocolFactory for convenience to assign a type parameter for the value type May 6, 2022
@npepinpe npepinpe added area/test Marks an issue as improving or extending the test coverage of the project area/maintainability Marks an issue as improving the maintainability of the project kind/toil Categorizes an issue or PR as general maintenance, i.e. cleanup, refactoring, etc. team/process-automation and removed area/maintainability Marks an issue as improving the maintainability of the project labels May 6, 2022
@npepinpe npepinpe self-assigned this May 6, 2022
@Zelldon Zelldon added the version:8.1.0 Marks an issue as being completely or in parts released in 8.1.0 label Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants