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

Differentiate options for sync and async SSRC initialization #2506

Merged
merged 2 commits into from
Apr 2, 2024

Conversation

erikeldridge
Copy link
Contributor

Discussion

It doesn't make sense to pass a cached template to getServerTemplate because the method loads a new template immediately.

I see a recommendation to define distinct interfaces for method options: microsoft/tsdoc#19.

So, this change splits ServerTemplateOptions into GetServerTemplateOptions and InitServerTemplateOptions.

Testing

Tested with npm test.

API Changes

Splits ServerTemplateOptions into GetServerTemplateOptions and InitServerTemplateOptions.

@erikeldridge erikeldridge self-assigned this Mar 22, 2024
Copy link
Member

@lahirumaramba lahirumaramba left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!
Left one comment

@@ -354,7 +354,21 @@ export interface ServerTemplateData {
/**
* Represents optional arguments that can be used when instantiating {@link ServerTemplate}.
*/
export interface ServerTemplateOptions {
export interface GetServerTemplateOptions {
Copy link
Member

Choose a reason for hiding this comment

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

Does it makes sense to create a base type and extend from it?

export interface InitServerTemplateOptions extends GetServerTemplateOptions {
      template?: ServerTemplateData,
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. I'll update it.

@erikeldridge erikeldridge merged commit 69c1262 into ssrc Apr 2, 2024
5 checks passed
@erikeldridge erikeldridge deleted the ssrc-options branch April 2, 2024 20:36
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.

None yet

2 participants