上一页 1 ··· 116 117 118 119 120 121 122 123 124 ··· 492 下一页
摘要: https://btholt.github.io/complete-intro-to-realtime/socketio https://btholt.github.io/complete-intro-to-realtime/intro-to-websockets Socket.io: FE: co 阅读全文
posted @ 2022-07-15 21:27 Zhentiw 阅读(37) 评论(0) 推荐(0)
摘要: https://btholt.github.io/complete-intro-to-realtime/intro-to-http2-push long-running HTTP call HTTP2 PUSH FE: async function getNewMsgs() { let reader 阅读全文
posted @ 2022-07-15 19:43 Zhentiw 阅读(56) 评论(0) 推荐(0)
摘要: Polling with setTimeout async function getNewMsgs() { let json; try { const res = await fetch("/poll"); json = await res.json(); } catch (e) { // back 阅读全文
posted @ 2022-07-15 19:10 Zhentiw 阅读(122) 评论(0) 推荐(0)
摘要: const $: any = {} /** * Get the <button> element with the class 'continue' * and change its HTML to 'Next Step...' */ $("button.continue").html("Next 阅读全文
posted @ 2022-07-15 15:56 Zhentiw 阅读(38) 评论(0) 推荐(0)
摘要: Refer: https://www.cnblogs.com/Answer1215/p/15084496.html A string is a primitive value, and all primitive values are immutable. Q1: const a = "Fronte 阅读全文
posted @ 2022-07-13 18:53 Zhentiw 阅读(228) 评论(0) 推荐(0)
摘要: Given this code as starter: export interface DataEntity { id: string } export interface Movie extends DataEntity { director: string } export interface 阅读全文
posted @ 2022-07-13 18:52 Zhentiw 阅读(37) 评论(0) 推荐(0)
摘要: Problem when typing Dictionaries: type Dict<T> = { [K: string]: T } const d: Dict<string[]> = {} d.rhubarb.join(", ") // 💥 Even `d.rhubarb` is undefi 阅读全文
posted @ 2022-07-13 17:57 Zhentiw 阅读(31) 评论(0) 推荐(0)
摘要: Since TypeScript v4.2, we can do remapping by using `as` keyword type Colors = "red" | "green" | "blue" type ColorSelector = { [K in Colors as `select 阅读全文
posted @ 2022-07-13 17:48 Zhentiw 阅读(37) 评论(0) 推荐(0)
摘要: String in Javascript is immutable. Means that once they were created, they cannot be modified. This also means that simple operations like appending a 阅读全文
posted @ 2022-07-13 01:16 Zhentiw 阅读(57) 评论(0) 推荐(0)
摘要: type Statistics = { [K in `${"median" | "mean"}Value`]?: number } Mappiing a sub type: // let winFns: "setInterval" | "setTimeout" type winFns = Extra 阅读全文
posted @ 2022-07-12 14:53 Zhentiw 阅读(37) 评论(0) 推荐(0)
上一页 1 ··· 116 117 118 119 120 121 122 123 124 ··· 492 下一页