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

增加Promise的then方法的扩展性 #106

Open
otakustay opened this issue Apr 4, 2014 · 2 comments
Open

增加Promise的then方法的扩展性 #106

otakustay opened this issue Apr 4, 2014 · 2 comments
Milestone

Comments

@otakustay
Copy link
Member

未来希望有个er-thenx的库,可以提供类似这样的功能:

promise.then.returnValue(foo); // 指定返回值
promise.then.bound(fn, thisObject); // 指定this对象
promise.then.getProperty('foo'); // 指定获取某个属性

当然也能这样:

promise.thenReturnValue(foo); // 指定返回值
promise.thenBound(fn, thisObject); // 指定this对象
promise.thenGetProperty('foo'); // 指定获取某个属性

不过都需要Promise的实现有一定的扩展性,可以往上加东西

@otakustay otakustay added this to the 3.2.0 milestone Apr 4, 2014
@otakustay otakustay modified the milestones: 3.1.1, 3.2.0 Apr 22, 2014
@otakustay
Copy link
Member Author

在promise库中实现

@otakustay
Copy link
Member Author

因为er无法直接改用promise库,所以这事还得在er中做一次

@otakustay otakustay reopened this Feb 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant