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

路由卸载功能支持 #8

Closed
Qquanwei opened this issue Aug 6, 2020 · 3 comments · Fixed by #10
Closed

路由卸载功能支持 #8

Qquanwei opened this issue Aug 6, 2020 · 3 comments · Fixed by #10
Assignees

Comments

@Qquanwei
Copy link

Qquanwei commented Aug 6, 2020

因为微前端方案需要做成应用可插拔,所以产生了需要卸载路由的需求。

尝试使用stop方法卸载:

stateman 提供了 stop 方法,但是该方法只卸载了内部histery, 组件依然在内存中,所以组件的destroy方法不会触发, 导致应用无法卸载干净,对于全局对象的事件没能及时销毁。

所以希望能够提供一种能够销毁方案来销毁整个应用, 例如在 https://github.com/regularjs/regular-state/blob/master/src/client.js#L157 这里新增一个 destroy 的生命周期,并重载 stateman 的 stop 方法调用 destroy 实现。

@leeluolee
Copy link
Member

整个应用指的是 卸载路由和销毁路由对应的View吗?

@Qquanwei
Copy link
Author

Qquanwei commented Aug 6, 2020

是的,销毁路由监听,销毁所有组件。

@leeluolee
Copy link
Member

周末改一下 @Qquanwei

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

Successfully merging a pull request may close this issue.

2 participants