04 2022 档案

摘要: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 阅读(30) 评论(0) 推荐(0) 编辑
摘要:class SDK { constructor(public loggedInUserId?: string) {} createPost(title: string) { this.assertUserIsLoggedIn(); createPost(this.loggedInUserId, ti 阅读全文
posted @ 2022-04-25 14:42 Zhentiw 阅读(43) 评论(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 阅读(297) 评论(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 阅读(35) 评论(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 阅读(59) 评论(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 阅读(23) 评论(0) 推荐(0) 编辑
摘要:Let's say we have a function accept any type but array. function anyTypesButNotArray<T>( val: T extends any[] ? "you should not pass in array" : T ) { 阅读全文
posted @ 2022-04-22 16:20 Zhentiw 阅读(26) 评论(0) 推荐(0) 编辑
摘要:Constructs a type consisting of the return type of function Type. https://www.typescriptlang.org/docs/handbook/utility-types.html import { configureSt 阅读全文
posted @ 2022-04-22 14:06 Zhentiw 阅读(381) 评论(0) 推荐(0) 编辑
摘要:This lesson demonstrates that you can get a small performance gain by removing AJAX calls that feed into redux from the react/hooks lifecycle. In this 阅读全文
posted @ 2022-04-11 14:24 Zhentiw 阅读(36) 评论(0) 推荐(0) 编辑
摘要:This lessons builds on Build lodash.debounce from scratch to add support for one of its more interesting options: maxWait. The maxWait option ensures 阅读全文
posted @ 2022-04-11 01:42 Zhentiw 阅读(71) 评论(0) 推荐(0) 编辑
摘要:This lesson will demonstrate how to recreate a simplified version of the popular lodash.debounce method from scratch. I literally failed a job intervi 阅读全文
posted @ 2022-04-11 01:30 Zhentiw 阅读(65) 评论(0) 推荐(0) 编辑
摘要:This lesson will demonstrate how to recreate a simplified version of the popular lodash.merge method from scratch. First we'll create a test file with 阅读全文
posted @ 2022-04-11 01:15 Zhentiw 阅读(105) 评论(0) 推荐(0) 编辑
摘要:Company plans to deploy Docker containers on AWS at lowest cost? Use ECS with a clsuter of SPot instances and enable Spot instance draining. Company p 阅读全文
posted @ 2022-04-04 21:52 Zhentiw 阅读(36) 评论(0) 推荐(0) 编辑
摘要:High availability and elastic scalbility for web servers? Use EC2 Auto Scaling and An application load balancer across multi AZs. Low-Latency connecti 阅读全文
posted @ 2022-04-04 21:37 Zhentiw 阅读(36) 评论(0) 推荐(0) 编辑
摘要:Global compnay needs to centrally manage creation of infrastructure services to accounts in AWS organizations? Define infrastructure in CloudFormation 阅读全文
posted @ 2022-04-04 19:50 Zhentiw 阅读(30) 评论(0) 推荐(0) 编辑
摘要:Snowball Edge used to transfer millions of small fiels using a shell script. Transfer times are very slow? Perform multiple copy operations at one tim 阅读全文
posted @ 2022-04-04 18:52 Zhentiw 阅读(36) 评论(0) 推荐(0) 编辑
摘要:Secuirty logs generated by AWS WAF musts be sent to a third-party auditing application? Send logs to Kinesis Data Firehose and configure the auditing 阅读全文
posted @ 2022-04-04 17:32 Zhentiw 阅读(36) 评论(0) 推荐(0) 编辑
摘要:API activity must be captured from multiple accounts and stored in a centra security account? Use CloudTrail in each account to record API activity an 阅读全文
posted @ 2022-04-04 14:32 Zhentiw 阅读(61) 评论(0) 推荐(0) 编辑
摘要:We'll learn how to use Next.js API Routes to hide sensitive information from the clients. In this case, we're calling the JSON Placeholder API with a 阅读全文
posted @ 2022-04-03 17:39 Zhentiw 阅读(41) 评论(0) 推荐(0) 编辑
摘要:We'll learn how to create a middleware function for next-connect. This middleware will work at the route level, for example, for every request that hi 阅读全文
posted @ 2022-04-03 17:36 Zhentiw 阅读(110) 评论(0) 推荐(0) 编辑
摘要:We'll learn an alternative way of creating API routes using the next-connect package. next-connect gives us an alternative that would feel familiar to 阅读全文
posted @ 2022-04-03 17:34 Zhentiw 阅读(37) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示