N
N
n1ksON2020-12-22 13:13:06
React
n1ksON, 2020-12-22 13:13:06

Can you rate the ReactJS + Redux test project?

Completed a test task for an internship in one company. They replied that they would not check my test (there are some reasons). Therefore, I turn to the experienced, they could evaluate the project. At least take a quick look, please, so that I understand how much shit I code)
Repository on GitHub

Answer the question

In order to leave comments, you need to log in

3 answer(s)
W
WbICHA, 2020-12-22
@n1ksON

1. There is no ifint or prettier.
2. No tests.
3. All commits without names.
4. Almost all comments are in Russian. And most of them describe banal things.

state[0] = state[index] // запись нового выбора на первое место
state.splice(index, 1) // удаление нового выбора с предыдущей позиции в массиве

5. Using comments for functions instead of docs.
6. I'm too lazy to figure it out, but sort doesn't fit here, does it?
spoiler
for (let i = 1; i < state.length; i++) { // сортировка от меньшего к большему по первому числу для возврата предыдущего выбора на правильную позицию
                    if (state[i].split(' ')[0] > beforeSelected.split(' ')[0]) {
                        state.splice(i, 0, beforeSelected) // запись предыдущего выбора на правильную позицию
                        break
                    } else if (state[i].split(' ')[0] === beforeSelected.split(' ')[0]) { // если первые числа равны проверка по второму числу
                        if (state[i].split(' ')[2] >= beforeSelected.split(' ')[2]) {
                            state.splice(i, 0, beforeSelected) // запись предыдущего выбора на правильную позицию
                            break
                        }
                    }
                    if (i === state.length - 1) { // если предыдущий выбор оказалася наибольшим
                        state.push(beforeSelected)
                        break
                    }
                }

7. Don't use destructuring in a function argument if you use the parameter only once.
spoiler
const resize = ({ param }) => { // изменение select
    ...
  }

This is equivalent to:
const resize = (obj) => { // изменение select
    const param = obj.param;
    ...
  }


8. All texts are hardcoded right in the code.
9. Python-style (where are the semicolons?).
10. Why do the types folder contain components and not types? This, of course, is zhs, not ts, but this does not change the essence.
In short, this is so, a cursory examination.

K
Kirill Makarov, 2020-12-22
@kirbi1996

I didn’t get into the editor, looking at the code in the react, everything seems to be fine, the only thing that caught my eye in the inline style is that you don’t need to write pixels, just the number is transferred there. Of course, it was also possible to better break the components folder. Let's leave the App at the root, create the pages folder in it, create the page, and leave the components in the components, but this is so nit-picking

V
VladJs, 2020-12-23
@VladJs

you cannot mutate data in the redux reducer, you need to do it through a copy. For example:
{
...state,
width : action.width
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question