Skip to content

Latest commit

 

History

History
27 lines (24 loc) · 523 Bytes

README.md

File metadata and controls

27 lines (24 loc) · 523 Bytes

es3-promise

The Promise realized using ES3 syntax

目的

  • 理解promise A+ 规范
  • 向下兼容老版本浏览器

介绍

  • 全程使用es3语法
  • 实现Prmoise
  • Promise.resolve/Promise.reject
  • 完整实现Promise.then
  • Promise.catch
  • Promise.all
  • 实现各种兼容处理

如何使用

node端和浏览器端皆可使用 只需引入cpromise.js即可

import "cpromise.js"
or 
<script src="cpromise.js"><script>
or
var {CPromise} = require("cpromise.js")

使用方法和原生promise完全一致