
源码系列
梅子丨朱
孤独是一个人的狂欢
展开
-
promise全家桶,再也不怕面试叫我手写了
promise初长成 //手写Promise全家桶 class myPromise{ //构造器 constructor(executor) { this.state = 'pending'; this.value = undefined; this.reason = undefined; //success const resolve = (value)=>{ if(this.state === 'pending'){原创 2021-03-01 12:57:35 · 327 阅读 · 0 评论 -
js 基础之new实现
function Person(name,age,sex) { this.name = name; this.age = age; this.sex = sex; } function newObj(Fn,args) { let re = {}; if(Fn.prototype !== null){ Object.setPrototypeOf(re,Fn.prototype);//指向Fn的原型 // re = Object.create(Fn.prototype);.原创 2020-12-17 13:47:50 · 265 阅读 · 0 评论 -
源码之路之@SpringBootApplication自动化配置源码解析
springBoot是目前最受欢迎的web应用框架之一,其最大的优点在于其自动化配置,使得用户不需要花太多时间到框架配置上,更多的可以注重业务逻辑。 BUT,我们既需要知其然,也需要知其所以然。那么springboot是怎样自动化装配的呢? 其最大的秘密在于springboot使用了强大的注解库:java.lang.annotation。当然,ssm框架也有注解,ssm框架的注解在应用中也是给...原创 2019-09-19 13:21:54 · 289 阅读 · 0 评论