上一页 1 ··· 55 56 57 58 59 60 61 62 63 ··· 491 下一页
摘要: import { afterEach, test, expect, vi, beforeEach } from 'vitest'; import { render } from 'test/utilities'; import TimeZone from '.'; beforeEach(() => 阅读全文
posted @ 2023-09-27 21:39 Zhentiw 阅读(48) 评论(0) 推荐(0)
摘要: 1. Globally import In vitest, you need to do import { it, expect, test } from 'vitest'; In every test files, If you don't want to do it you can set co 阅读全文
posted @ 2023-09-20 01:33 Zhentiw 阅读(65) 评论(0) 推荐(0)
摘要: type WidenLiteral<T> = T extends string | number | boolean ? ReturnType<T["valueOf"]> : T; type Example1 = WidenLiteral<"abc"> // string type Example2 阅读全文
posted @ 2023-09-20 01:29 Zhentiw 阅读(10) 评论(0) 推荐(0)
摘要: class Observable { constructor(subscribe) { this._subscribe = subscribe; } subscribe(observer) { return this._subscribe(observer); } static of(value) 阅读全文
posted @ 2023-09-12 16:04 Zhentiw 阅读(7) 评论(0) 推荐(0)
摘要: class Observable { constructor(subscribe) { this._subscribe = subscribe; } subscribe(observer) { return this._subscribe(observer); } static concnat(.. 阅读全文
posted @ 2023-09-12 15:44 Zhentiw 阅读(10) 评论(0) 推荐(0)
摘要: const tasks = of([....]); /** * { * ...{ ...4......5......2} * ...........{3...........2...5} * ..................................{6.... 3} * ........ 阅读全文
posted @ 2023-09-08 15:39 Zhentiw 阅读(7) 评论(0) 推荐(0)
摘要: function Observable(forEach) { this._forEach = forEach; } Observable.prototype = { forEach: function (onNext, onError, onCompleted) { if (typeof onNex 阅读全文
posted @ 2023-09-05 20:57 Zhentiw 阅读(14) 评论(0) 推荐(0)
摘要: Omit on Union type type Union = | { a: "a"; user?: string; } | { b: "b"; user?: string; }; type X = Omit<Union, "user">; // X is {} Using Distributive 阅读全文
posted @ 2023-09-02 19:12 Zhentiw 阅读(12) 评论(0) 推荐(0)
摘要: The `as` Prop in React Option 1: import { Equal, Expect } from '../helpers/type-utils'; export const Wrapper = <TProps extends keyof JSX.IntrinsicElem 阅读全文
posted @ 2023-08-31 19:53 Zhentiw 阅读(35) 评论(0) 推荐(0)
摘要: import { Router, useRouter } from "fake-external-lib"; export const withRouter = <TProps extends { router: Router }>( Component: React.ComponentType<T 阅读全文
posted @ 2023-08-30 15:07 Zhentiw 阅读(20) 评论(0) 推荐(0)
上一页 1 ··· 55 56 57 58 59 60 61 62 63 ··· 491 下一页