上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 497 下一页
摘要: async function asy1() { console.log(1) await asy2() console.log(2) } asy2 = async () => { // First set // await setTimeout((_) => { // Promise.resolve 阅读全文
posted @ 2024-10-06 00:17 Zhentiw 阅读(20) 评论(0) 推荐(0)
摘要: We often see circular dependency, why it's a problem, why we should avoid it and hwo to avoid it? Let's see any example first // main.js import A from 阅读全文
posted @ 2024-10-05 20:16 Zhentiw 阅读(48) 评论(0) 推荐(0)
摘要: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"/> <title>CSS avatar scale</title> <style> .avatar { width: 150px; height: 150px; backgro 阅读全文
posted @ 2024-10-05 19:56 Zhentiw 阅读(23) 评论(0) 推荐(0)
摘要: function observe(obj) { for (const key in obj) { let internalValue = obj[key]; const funs = new Set() Object.defineProperty(obj, key, { configurable: 阅读全文
posted @ 2024-09-24 01:21 Zhentiw 阅读(25) 评论(0) 推荐(0)
摘要: Let's say we have a Vue application that renders many heavy components on the first load. The problem we're facing is a long white screen period while 阅读全文
posted @ 2024-09-15 20:49 Zhentiw 阅读(24) 评论(0) 推荐(0)
摘要: In a production environment, we want to prompt the user with a message when new scripts are available, asking New scripts are available. Do you want t 阅读全文
posted @ 2024-09-15 20:24 Zhentiw 阅读(35) 评论(0) 推荐(0)
摘要: export const isPromiseLike = <T>(value: PromiseLike<T>) => value !== null && (typeof value 'object' || typeof value 'function') && typeof value.then ' 阅读全文
posted @ 2024-09-15 01:57 Zhentiw 阅读(13) 评论(0) 推荐(0)
摘要: export const isAsyncFunction = (fn: Function) => fn[Symbol.toStringTag] 'AsyncFunction'; // isAsyncFunction(() => {}) // false // isAsyncFunction(() = 阅读全文
posted @ 2024-09-15 01:52 Zhentiw 阅读(23) 评论(0) 推荐(0)
摘要: type BanType<T, E> = T extends E ? never : T; type BanDate<T> = BanType<T, Date>; function log<T>(x: BanDate<T>) { console.log() } log(new Date()) // 阅读全文
posted @ 2024-09-09 14:55 Zhentiw 阅读(27) 评论(0) 推荐(0)
摘要: .callmethod exits on any function, which will refer to Function.prototype.call for example: console.log.call Function.prototype.call // call Also it m 阅读全文
posted @ 2024-09-09 14:52 Zhentiw 阅读(28) 评论(0) 推荐(0)
上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 497 下一页