上一页 1 ··· 105 106 107 108 109 110 111 112 113 ··· 498 下一页
摘要: import {ErrorBoundary, FallbackProps} from 'react-error-boundary' const userState = selectorFamily({ key: 'user', get: (userId: number) => async () => 阅读全文
posted @ 2022-10-11 01:48 Zhentiw 阅读(74) 评论(0) 推荐(0)
摘要: Ever wanted just a bit of autocomplete? Here, we create a TypeScript helper called LooseAutocomplete which gives us autocomplete while also allowing a 阅读全文
posted @ 2022-10-10 14:17 Zhentiw 阅读(36) 评论(0) 推荐(0)
摘要: Deep partials are SUPER useful and not natively supported by TypeScript. Here, I use one to help with mocking an entity in a (imaginary) test file. ty 阅读全文
posted @ 2022-10-10 14:10 Zhentiw 阅读(168) 评论(0) 推荐(0)
摘要: You can throw detailed error messages for type checks. Here, I move a runtime check in a function to the type level, meaning you get a detailed error 阅读全文
posted @ 2022-10-09 20:41 Zhentiw 阅读(41) 评论(0) 推荐(0)
摘要: By default, throttleTime(x), after first event emit, then wait for x amount of time, then emit another latest value. All the values between the waitin 阅读全文
posted @ 2022-10-09 20:20 Zhentiw 阅读(32) 评论(0) 推荐(0)
摘要: You're given a non-empty array of positive integers where each integer represents the maximum number of steps you can take forward in the array. For e 阅读全文
posted @ 2022-10-09 20:07 Zhentiw 阅读(41) 评论(0) 推荐(0)
摘要: Just for fun... Given a number (always positive) as a type. Your type should return the number decreased by one. For example: type Zero = MinusOne<1> 阅读全文
posted @ 2022-10-07 22:57 Zhentiw 阅读(77) 评论(0) 推荐(0)
摘要: You can use generics in React to make incredibly dynamic, flexible components. Here, I make a Table component with a generic 'items' type. interface T 阅读全文
posted @ 2022-10-07 18:13 Zhentiw 阅读(47) 评论(0) 推荐(0)
摘要: Drop a specified char from a string. For example: type Butterfly = DropChar<' b u t t e r f l y ! ', ' '> // 'butterfly!' /* _____________ Your Code H 阅读全文
posted @ 2022-10-07 01:08 Zhentiw 阅读(34) 评论(0) 推荐(0)
摘要: Implement PercentageParser. According to the /^(\+|\-)?(\d*)?(\%)?$/ regularity to match T and get three matches. The structure should be: [plus or mi 阅读全文
posted @ 2022-10-06 02:11 Zhentiw 阅读(30) 评论(0) 推荐(0)
上一页 1 ··· 105 106 107 108 109 110 111 112 113 ··· 498 下一页