Skip to content

Commit

Permalink
add ts-ignore for getHubProxyFactory() and getReceiverRegister() to a…
Browse files Browse the repository at this point in the history
…void "TS7030: Not all code paths return a value."
  • Loading branch information
Montellese committed Jun 8, 2023
1 parent 0da0607 commit 9b9f1b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/TypedSignalR.Client.TypeScript/Templates/ApiTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public constructor(
this.Write(this.ToStringHelper.ToStringWithCulture(hubType.Name));
this.Write(">;\r\n");
}
this.Write("}\r\n\r\nexport const getHubProxyFactory = ((hubType: string) => {\r\n");
this.Write("}\r\n\r\n// @ts-ignore\r\nexport const getHubProxyFactory = ((hubType: string) => {\r\n");
foreach(var hubType in HubTypes) {
this.Write(" if(hubType === \"");
this.Write(this.ToStringHelper.ToStringWithCulture(hubType.Name));
Expand All @@ -90,7 +90,8 @@ public constructor(
this.Write(this.ToStringHelper.ToStringWithCulture(receiverType.Name));
this.Write(">;\r\n");
}
this.Write("}\r\n\r\nexport const getReceiverRegister = ((receiverType: string) => {\r\n");
this.Write("}\r\n\r\n// @ts-ignore\r\nexport const getReceiverRegister = ((receiverType: string) =>" +
" {\r\n");
foreach(var receiverType in ReceiverTypes) {
this.Write(" if(receiverType === \"");
this.Write(this.ToStringHelper.ToStringWithCulture(receiverType.Name));
Expand Down
2 changes: 2 additions & 0 deletions src/TypedSignalR.Client.TypeScript/Templates/ApiTemplate.tt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export type HubProxyFactoryProvider = {
<# } #>
}

// @ts-ignore
export const getHubProxyFactory = ((hubType: string) => {
<# foreach(var hubType in HubTypes) { #>
if(hubType === "<#= hubType.Name #>") {
Expand All @@ -64,6 +65,7 @@ export type ReceiverRegisterProvider = {
<# } #>
}

// @ts-ignore
export const getReceiverRegister = ((receiverType: string) => {
<# foreach(var receiverType in ReceiverTypes) { #>
if(receiverType === "<#= receiverType.Name #>") {
Expand Down

0 comments on commit 9b9f1b0

Please sign in to comment.