Closed mil22n closed 5 years ago
Hey @mil22n
Had some time this morning to review your test and I've got some questions and feedback for the frontend part of it. Another colleague will follow up on the backend related part.
Why did you choose redux-promise
over redux-thunk
?
talk-row.component.js
- handleVote
& handleUnvote
methodstalks.actions.js
- updateTalk
redux-promise-middleware
is the active fork of this moduleredux-promise
(or the redux-promise-middleware version
) for your next project?In the tests for Talk
and Submit
components, you're also mounting the Provier
and Router
, was there an intentional decision to test it like this?
Talk
or Submit
were mocked instead of using Redux.If I arrive on the page without ever visiting, the logout button is shown. In order to login I first have to logout, despite never logging in to begin with. It also looks like anonymous users should not be able to vote, however it seems as though it's possible. Probably related to this bug.
/utils
directory, but seeing as there are not many of them no problem in this casethis.props.xyz
in the JSX, could have cut down on it with const { xyz, abc } = this.props
to make it a little easier to read.render
(eg. <button onClick={this.func.bind(this)}>
) instead of in the constructorSo as said above, this is for the frontend part, you'll get some feedback on the backend soon (friday latest). For now though, if you could answer the questions above and maybe take a look at the bug. Aside from all that, it looks good, quite happy with the frontend code you've submitted.
Hey @Jamesford, thanks for your comments and a very detailed and professional review.
Why did you choose
redux-promise
overredux-thunk
?
redux-promise
and I didn't work with redux-thunk
before. In hindsight I should have used the opportunity to try it out.Also it seems to have forced you into mixing Promises and Callbacks
handleVote
and handleUnvote
. I am not really happy about that part myself.Would you still use
redux-promise
(or theredux-promise-middleware version
) for your next project?
In the tests for
Talk
andSubmit
components, you're also mounting theProvider
andRouter
, was there an intentional decision to test it like this?
Fixed the issue of user with the undefined username being added to the auth
state when the checkSession
action was called.
Instructions for setting up the environment and running the app are in README.doc.md file.
I created the server using the Loopback framework, but it is pretty bare boned and with no authentication. There is a dummy login page which just stores the user in the localStorage.
For the client, I've used React with Redux.
The tests are not complete as I am late to submit the project but actions, reducers and a couple key components were covered.
Looking forward to your review.