上一页 1 ··· 75 76 77 78 79 80 81 82 83 ··· 469 下一页
摘要: const { TestScheduler } = require("rxjs/testing"); const { map } = require("rxjs/operators"); const { concat } = require("rxjs"); describe("Marble tes 阅读全文
posted @ 2022-10-13 20:09 Zhentiw 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(31) 评论(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 阅读(16) 评论(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 阅读(33) 评论(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 阅读(26) 评论(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 阅读(24) 评论(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 阅读(55) 评论(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 阅读(17) 评论(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 阅读(135) 评论(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 阅读(20) 评论(0) 推荐(0) 编辑
上一页 1 ··· 75 76 77 78 79 80 81 82 83 ··· 469 下一页