Answer the question
In order to leave comments, you need to log in
What is the right way to write code in this situation?
How can you avoid creating variables that perform essentially one action? As for me, the code looks dumb. if, for example, I still have a dozen more "scenes" connections from other files in this file and switching to them again I will have to declare 3-5 variables each time like this.
const BS = new BotScene();
const Botscene = new Stage([BotScene.mainMenu()]);
controlPanelScene.use(Botscene.middleware());
Answer the question
In order to leave comments, you need to log in
I see two variables, and BS is not used at all, and Botscene is used once, and it can be inlined like this
controlPanelScene.use(new Stage([BotScene.mainMenu()]).middleware());
True, readability suffers, although it is not very good anyway :)Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question