
本文共 2320 字,大约阅读时间需要 7 分钟。
���JavaScript���Promise������������Promise.prototype.finally()
���������������������������������������������������Promise������������������������������������������������������������������������������������������������������������������������������������������������ cleanup���������������������������������������������������������������������������
finally���������������������
finally������������������������Promise���������Promise���������������������Promise������������������������������������Promise���
then()
���catch()
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������1���loading������
���UI������������������loading���������������������������������������������������������������������������������������loading���������������������������������������������������������������������������������������������������������������������loading���������������������������������������������������������������������loading������������finally������������������������������������������������������������������������
then()
���catch()
���������������������������������������������������������������������������������������������������2������������������������
let connection = null;
db.open().then(() => { connection = $this;return connection.select({ name: 'Jane' });}).then(result => {// ������������// ������connection������������������}).catch(error => {// ������������}).finally(() => {connection.close();})
���������������������������������������finally��������������������������� Promise ������������������������������������������������������connection.close()������������������������������������
then()
���catch()
������������������������ clearance ���������������������������������������������������������������������������������
Promise.prototype.finally()
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
发表评论
最新留言
关于作者
