摘要:
https://bestofjs.org/projects/valtio Cool things about Valtio, it is completely independ from React component. It is self testable and hook with React 阅读全文
摘要:
Implement a type-level integers comparator. We've provided an enum for indicating the comparison result, like this: If a is greater than b, type shoul 阅读全文
摘要:
Implement the JavaScript Array.slice function in the type system. Slice<Arr, Start, End> takes the three argument. The output should be a subarray of 阅读全文
摘要:
It is useful to enable '@typescript-eslint/unbound-method': 'error', because this kind of error is related to this keyword, sometime it is hard to not 阅读全文
摘要:
Create a SnakeCase<T> generic that turns a string formatted in camelCase into a string formatted in snake_case. A few examples: type res1 = SnakeCase< 阅读全文
摘要:
Let's say we want to extract query param from string: type UserPath = "/users/:id"; type UserOrganisationPath = "/users/:id/organisations/:organisatio 阅读全文
摘要:
We start with a Values interface: interface Values { email: string; firstName: string; lastName: string; } We want a union of tuple [key, value]as res 阅读全文