I am currently building a simple web element editor with React using Redux. It works as it should work with a small number of elements. I can see though that when the number of elements gets on a two digit scale, it will be frustrating to organize and maintain. The reason is because I have to pass [IDs and names (local to the function data), State, Actions] to the function I call which in turn filters the arguments and calls other functions with the right arguments etc. I think it is more ifs than it is needed. Can it be done with a function where I can have all the state and the actions, pass it some arguments, choose the correct path and done?
I do not think that providing code will help with this question, you would have see my file system as well to have the whole picture.
I am a junior developer so please forgive me if this is a stupid question or similar. Thank you in advance!
question from:
https://stackoverflow.com/questions/65926206/is-there-a-way-to-have-a-function-where-given-some-arguments-it-returns-state-a 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…