Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kit.Promise使用方法 #5

Open
Kelichao opened this issue Feb 4, 2017 · 0 comments
Open

kit.Promise使用方法 #5

Kelichao opened this issue Feb 4, 2017 · 0 comments

Comments

@Kelichao
Copy link
Owner

Kelichao commented Feb 4, 2017

kit.Promise

// 初始化Promise对象
var promise = new kit.Promise();

// 设置触发方式
promise
// when中的this指向promise实例
// 如果触发了deliver即调用订阅列表中的方法
.when(function() {console.log(this);this.deliver();})
// 订阅的第一个事件
.subscribe(function() {console.log(111)})
// 订阅的第二个事件
.subscribe(function() {console.log(222)});
@Kelichao Kelichao changed the title Promise使用方法 kit.Promise使用方法 Feb 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant