Skip to content

FileTree 重新实现 #71

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

Merged
merged 5 commits into from
Mar 14, 2017
Merged

FileTree 重新实现 #71

merged 5 commits into from
Mar 14, 2017

Conversation

hackape
Copy link
Contributor

@hackape hackape commented Mar 10, 2017

借鉴 mobx 的思想,比较好的重新实现了 FileTree 的模型,用了大量 getter 每次从源数据重新计算需要的值,这样仍旧符合函数式思路,没有维护过程状态的负担,但能使得 API 层面保留 OO 式的操作便利。

@hackape
Copy link
Contributor Author

hackape commented Mar 10, 2017

另外重做了一下文件树的 css 样式,以便之后实现拖拽时高亮文件夹等操作。


export function openNode (node, shouldBeFolded = null, deep = false) {
return (dispatch, getState) => {
if (node.isDir) {
if (node.shouldBeUpdated) {
if (true || node.shouldBeUpdated) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是干啥的

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修

@hackape hackape merged commit d2e4d95 into master Mar 14, 2017
@hackape hackape deleted the hackape/tree-rework branch August 4, 2017 02:53
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 this pull request may close these issues.

2 participants