-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
Loading indicator in tree #27
Conversation
const nodeWhichIsNotLoadingAnymore = $set(updatedRootInStore, 'isLoading', false); | ||
this.updateNode(nodeWhichIsNotLoadingAnymore); | ||
this.store.dispatch(actions.UI.PageTree.setSubTree(storePath, json)); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for this part, I'd be curious about a code review, specifically:
- is this code idiomatic?
- is the name "nodeWhichIsNotLoadingAnymore" good? (I think not). Better suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Sebastian,
thanks for this PR :). To your questions:
is this code idiomatic?
Looks good to me. But I have to admit, that I'm about to refactor the entire server-communication with redux-thunk to get rid of those lengthy Promise chains and have loading state handled more implicitly. I will also refactor the service layer into a purely functional form, since the current architecture invites to introduce side effects.
is the name "nodeWhichIsNotLoadingAnymore" good? (I think not). Better suggestions?
I agree there, it seems a bit off^^. Since you have two isomorphic operations going on before and after the remote call, I would suggest to describe that with preLoadingRootState
and postLoadingRootState
or something in that fashion. In this particular case, I think it's even okay to drop the constants alltogether and just pass the $set
call to the update method. The resulting statement seems pretty descriptive anyway and since the updated node state objects are not reused anywhere else, it might be okay to omit the assignments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@grebaldi has written what I was about to write, and what I had already suggested to Tyll. Great we're on the same page here!
Looks good, as @grebaldi said, we will refactor the promise based actions later on with redux-thunk :) 👍 |
I merged this for now, since it works with the current implementation and thus will be carried over for the refactoring. |
…s-0.6.0 Update postcss-css-variables to version 0.6.0 🚀
No description provided.