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

需要一个与destroy同级的类似recycle的方法供用户实现 #131

Closed
leeluolee opened this issue Sep 28, 2016 · 1 comment
Closed

Comments

@leeluolee
Copy link
Member

leeluolee commented Sep 28, 2016

destroy 设计失误,即作为生命周期方法,又充当公共方法,并且很多人在扩展destroy方法后忘记使用this.supr 导致 组件没有被回收 (因为大部分自动清理工作是在Regular#destroy中处理)

更改如下:

添加一个destroy的alias $destroy方法,效果与destroy一样, 但是与其它接口风格一致,声明这个接口为Public实例接口

添加一个用户自定义的比如recycle的生命周期函数(与config, init一致), 这个函数会在$destroy内部被调用,用户无需去关心this.supr

原来的使用方式,仍然允许,(可能考虑在检测到用户扩展destroy 给予警告)

@leeluolee leeluolee added this to the 0.6.0 milestone Mar 14, 2017
@leeluolee
Copy link
Member Author

#221 重复了

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