Skip to main content
1 vote
1 answer
39 views

I made a React component with the following props: interface Props<TData> { data: TData; idField: keyof TData; onClick: (id: TData[Props<TData>['idField']]) => void; // 'id' ...
r0n's user avatar
  • 11
0 votes
0 answers
99 views

This concept has a several different possible names which might be used to describe the concept. "Newtype" usually specifically refers to the implementation of the strong type pattern in a ...
user2138149's user avatar
0 votes
2 answers
246 views

I have a situation where I have to return a typed nil. The only way I know of to "make" a typed nil is .. // need to return String nil var x: String? = nil return x .. // need to return ...
Fattie's user avatar
  • 9,842
0 votes
1 answer
381 views

I recently started diving deeper into the Clean Architecture realm with the Ardalis project template. Here is a link to the nuget package to get started with the template.) I have been reading about ...
GoldenWRaft's user avatar
0 votes
2 answers
427 views

I'm getting this error in C# on .NET 8.0 (and .NET 6.0 if I'm being pedantic): Error CS0411: The type arguments for method 'Foo.Execute<I, O>(Func<I, O>)' cannot be inferred from the ...
ro_'s user avatar
  • 1
0 votes
1 answer
63 views

I'm trying to create an err function to be used by bash-scripts. The function is supposed to emulate BSD's errx(3) -- printing the specified message and exiting with the code specified as the first ...
Mikhail T.'s user avatar
  • 4,340
1 vote
1 answer
571 views

I'm currently diving into Domain-Driven Design (DDD) and putting it into practice with EF Core. In my domain model, I've opted for strongly typed identifiers. To accommodate this in EF Core, I've ...
Marco's user avatar
  • 11
5 votes
2 answers
9k views

I am trying to figure out how to patch form array in a typed reactive Angular form. patchValue and setValue does not work in my mind consistently with FormControl for example. Here is a form this....
Sergey Barskiy's user avatar
2 votes
0 answers
297 views

The union of (arg: string) => void and (arg: number) => void is (arg: never) => void, because no value can be a string and a number at the same time. But how can I work around this issue in ...
Pietro Carrara's user avatar
0 votes
1 answer
277 views

so I have this TypeScript class where I have a generic and a property of type keyof generic, like this: export class ColumnDefinition<T> { field: keyof T } Compiler complains because it ...
Heila Al-Mogren's user avatar
3 votes
2 answers
193 views

I have the following setup in TypeScript: abstract class Test { public abstract method1(param1: string): number; public abstract method2(param1: number, param2: string): Promise<number>; ...
CrystalSpider's user avatar
0 votes
2 answers
199 views

Imagine a struct... struct Pair { letter: Letter, number: Number, } enum Letter {A, B, C} enum Number {One, Two, Three} The total number of combinations in this struct would be 3 x 3 = 9, ...
StaticESC's user avatar
1 vote
1 answer
191 views

I am fairly new to strong typing but have been working in TypeScript for a little while now. I am starting to work through the Type Challenges to get better at strong typing and having a strong ...
kalisjoshua's user avatar
  • 2,536
1 vote
1 answer
2k views

I want to get object keys type, here i write a generic for object with keys as string type GenericInput = { [key:string]: {value:string,type:HTMLInputTypeAttribute,placeholder:string,min?:number,max?...
Badar's user avatar
  • 53
1 vote
1 answer
51 views

I want my code editor to infer the type of extraData based on the value of error which is being narrowed by the if statement: export enum ErrorCodes { Unknown = 'UNKWN', BadRequest = 'BDREQ', } ...
Jenryk's user avatar
  • 13

15 30 50 per page
1
2 3 4 5
30