ICode9

精准搜索请尝试: 精确搜索
  • 宏任务和微任务2022-08-29 18:33:07

    参考:https://www.jianshu.com/p/bcbf7894027c      示例 1:宏任务中包含微任务 (function() {     setTimeout(() => {         console.log(1)         new Promise((res, rej) => {             res()         }).then(() => console.log(2))      

  • 【原创】Promise异步编程2022-08-11 12:30:37

      show me the code function getPromise(cbk){ return (new Promise(cbk)); } getPromise(function (res,rej) { res("suc1") //只会执行一个,并把参数传递到catch或者then rej("err1") }).catch(function(err){ console.log(err,1) }).then(function

  • 【微信小程序】封装request请求模块/wx小程序手动封装Promise2022-08-07 21:35:17

    // 封装请求模块 const Promise = require('./Promise.js'); const baseUrl = 'http://127.0.0.1:8080/'; function request(method, url, data) { return new Promise((res,rej) => { let header = { 'content-type': 'applicati

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有