我想使用promises来处理,但是我的回调API的格式如下:
window.onload; // 设置为回调函数
...
window.onload = function() {
};
function request(onChangeHandler) {
...
}
request(function() {
// 发生了变化
...
});
function getStuff(dat, callback) {
...
}
getStuff("dataParam", function(err, data) {
...
})
API;
API.one(function(err, data) {
API.two(function(err, data2) {
API.three(function(err, data3) {
...
});
});
});
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号