上一页 1 ··· 119 120 121 122 123 124 125 126 127 ··· 492 下一页
摘要: Entity: Employee.java package com.skillsoft.springdatajpa.model; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import java 阅读全文
posted @ 2022-05-19 03:05 Zhentiw 阅读(55) 评论(0) 推荐(0)
摘要: export function assertType<T>(obj: unknown = {}): T { return obj as T } const store = assertType<Store>({select: () => of()}) 阅读全文
posted @ 2022-05-09 14:34 Zhentiw 阅读(46) 评论(0) 推荐(0)
摘要: Containerization of State within Child React Components The changing of state is the reason why components re-render. If you lift all of your state up 阅读全文
posted @ 2022-05-04 02:35 Zhentiw 阅读(79) 评论(0) 推荐(0)
摘要: Sometimes one line of code can eliminate 50% of your bundle size. As you'll see in this video, we can remove "dead code" from modules we are working w 阅读全文
posted @ 2022-05-01 21:54 Zhentiw 阅读(45) 评论(0) 推荐(0)
摘要: export type Letter = 'a' | 'b' | 'c' type RemoveC<TType> = TType extends 'c' ? never: TType; type WithoutC = RemoveC<Letter>; 阅读全文
posted @ 2022-04-25 14:48 Zhentiw 阅读(37) 评论(0) 推荐(0)
摘要: class SDK { constructor(public loggedInUserId?: string) {} createPost(title: string) { this.assertUserIsLoggedIn(); createPost(this.loggedInUserId, ti 阅读全文
posted @ 2022-04-25 14:42 Zhentiw 阅读(49) 评论(0) 推荐(0)
摘要: Config store app/store.ts import { configureStore } from "@reduxjs/toolkit"; export const store = configureStore({ reducer: {} }); main.tsx import Rea 阅读全文
posted @ 2022-04-23 17:59 Zhentiw 阅读(313) 评论(0) 推荐(0)
摘要: Let's see when we have following code: interface Animal { name: string; } interface Human { firstName: string; lastName: string; } const getDisplayNam 阅读全文
posted @ 2022-04-22 20:30 Zhentiw 阅读(44) 评论(0) 推荐(0)
摘要: For example we have a type like this: type Obj = { a: "a"; a2: "a2"; a3: "a3"; b: "b"; b1: "b1"; b2: "b2"; }; We want to constrct a new type which por 阅读全文
posted @ 2022-04-22 18:07 Zhentiw 阅读(67) 评论(0) 推荐(0)
摘要: For example we have two types, we want to find the shared props in both: interface UserBase { email: string image: string | null username: string } in 阅读全文
posted @ 2022-04-22 17:37 Zhentiw 阅读(27) 评论(0) 推荐(0)
上一页 1 ··· 119 120 121 122 123 124 125 126 127 ··· 492 下一页