上一页 1 ··· 105 106 107 108 109 110 111 112 113 ··· 499 下一页
摘要: For example there is a clas: export class ModifierState { /** * Returns the modifier state applicable to the keyboard event given. * @param event The 阅读全文
posted @ 2022-10-13 18:13 Zhentiw 阅读(40) 评论(0) 推荐(0)
摘要: export type PickValue<T extends object, K = keyof T> = K extends keyof T ? T[K] : never; interface Person { name: string; address: { postcode: string; 阅读全文
posted @ 2022-10-13 00:00 Zhentiw 阅读(30) 评论(0) 推荐(0)
摘要: AtomFamily For example, you have list of elements. We want to avoid that single elemenet got changed, whole list got re-render. Also want to share the 阅读全文
posted @ 2022-10-12 01:26 Zhentiw 阅读(64) 评论(0) 推荐(0)
摘要: Using cache class to reduce API calls import {Button} from '@chakra-ui/button' import {Input} from '@chakra-ui/input' import {Box, Divider, Heading, V 阅读全文
posted @ 2022-10-12 01:12 Zhentiw 阅读(41) 评论(0) 推荐(0)
摘要: interface: export type ElementStyle = { position: {top: number; left: number} size: {width: number; height: number} } export type Element = {style: El 阅读全文
posted @ 2022-10-11 02:17 Zhentiw 阅读(46) 评论(0) 推荐(0)
摘要: 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 阅读(170) 评论(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 阅读(34) 评论(0) 推荐(0)
上一页 1 ··· 105 106 107 108 109 110 111 112 113 ··· 499 下一页