Function Types in TypeScript | Best Practices

Function Types in TypeScript | Best Practices

TypeScript TV with Benny

1 год назад

1,063 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@7minutesdead
@7minutesdead - 16.09.2022 12:04

Would you be able to use angled brackets so you could keep your "export function etc" style of declaring your function?
Like `export function sortJSON<SortFunction>(text: string): SortSuccess | SortError {`

Ответить
@cshd
@cshd - 04.08.2022 18:21

what extention do you use to auto import types? I have auto import but it doesnt add it as a type.

Ответить
@antonioquintero-felizzola5334
@antonioquintero-felizzola5334 - 22.07.2022 15:49

Hey Benny, great video as usual. I think you can export that function type in one line by doing: export type SortFunction = (input: string) => SortSucess | SortError

Ответить