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

feat(node): unified node constructor #104

Merged
merged 5 commits into from
Sep 30, 2021
Merged

feat(node): unified node constructor #104

merged 5 commits into from
Sep 30, 2021

Conversation

Wondertan
Copy link
Member

Context

In #86 we moved Open/Init/IsInit functions over the unified pattern where they receive Node Type as param. Now, it makes total sense to introduce a New Node constructor to would instantiate a Node for a given type. For now, old constructors(NewFull/NewLight) are preserved, same as with DefaultLight(Full)Config but we can make them private and/or remove them if we find a reason for that in future

liamsi
liamsi previously approved these changes Sep 30, 2021
Copy link
Member

@liamsi liamsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgmt

node/full_test.go Show resolved Hide resolved
node/node.go Show resolved Hide resolved
node/node.go Outdated Show resolved Hide resolved
@Wondertan
Copy link
Member Author

@Bidon15, @liamsi
Well, I can decide myself whether we should make Default(Type)Config() and New(Type) private. I have arguments in my hand for public and private semantics, and I like them both. So let's vote with thumbs up on the comment for making them private or thumbs down for keeping them public.

renaynay
renaynay previously approved these changes Sep 30, 2021
Copy link
Member

@renaynay renaynay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls make NewFull and NewLight private, otherwise lgtm

@Wondertan Wondertan dismissed stale reviews from renaynay and liamsi via c679f59 September 30, 2021 12:31
@Wondertan
Copy link
Member Author

  • Removed New(Type) and Default(Type)Config entirely
  • Slightly enhanced lifecycling

Copy link
Member

@Bidon15 Bidon15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@Wondertan Wondertan merged commit 8d0db53 into main Sep 30, 2021
@Wondertan Wondertan deleted the hlib/typed-node-new branch September 30, 2021 14:15
@Wondertan Wondertan restored the hlib/typed-node-new branch January 7, 2022 14:40
@Wondertan Wondertan deleted the hlib/typed-node-new branch January 7, 2022 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants