前端工程化
红99
这个作者很懒,什么都没留下…
展开
-
手撕Promise之从0开始实现完整的Promise的对象-all/race函数实现
var MyPromise = function (fn) { // 更新状态和值 this.PromiseState = 'pending' this.PromiseResult = undefined // 定义then的回调函数 this.thenCallback = undefined; // 定义catch的回调函数 this.catchCallback = undefined; var _this = this; var resolve = function原创 2022-02-24 15:46:21 · 387 阅读 · 0 评论 -
手撕Promise之从0开始实现完整的Promise的对象-catch函数实现
var MyPromise = function (fn) { // 更新状态和值 this.PromiseState = 'pending' this.PromiseResult = undefined // 定义then的回调函数 this.thenCallback = undefined; // 定义catch的回调函数 this.catchCallback = undefined; var _this = this; var resolve = functio原创 2022-02-24 15:08:54 · 293 阅读 · 0 评论 -
手撕Promise之从0开始实现完整的Promise的对象-then函数实现
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document&l原创 2022-02-23 15:52:08 · 329 阅读 · 0 评论 -
手把手教你优雅的生成前端脚手架(一):初始化包并发布npm【附源码】
手把手教你优雅的生成前端自己的脚手架新建一个空项目初始化包增加bin和index.js文件编辑bin下面index.js文件,代码如下将当前package链接到全局发布npm包下载npm包增加功能废话不多说!!!新建一个空项目初始化包npm init -y然后在package.json新增两项 "bin": { "qiji-cli": "./bin/index.js" }, "private":falsebin目录下的qiji-cli表示,我们在命令行输入qiji-cli会原创 2021-06-16 11:04:18 · 505 阅读 · 0 评论