Blitzmachine
Blitzmachine3w ago

.blitzmachine – 18-43 Aug 27

Is this a good pattern or not, in JS specially, to wrap my custom logic around an object, before I decide how to initialize /& return it?
No description
8 Replies
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
Blitzmachine
BlitzmachineOP2w ago
Sorry. I want to initialize my webGL renderer. After initialized, you still have to setup some things .. Instead of doing it in the main module .. I split it like this, for more dynamic usage .. I guess. I mean the entire module. So destruction and return. Also the way of how I handle the parameters incase something is not passed. Sounds stupid .. but kinda trying to learn some JS patterns without the need of TS
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
Blitzmachine
BlitzmachineOP2w ago
I return the renderer at the beginning of the func if it is defined. Just noticed that it kinda looks like the singleton pattern
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
Blitzmachine
BlitzmachineOP2w ago
The mutable var is outside of the scope
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
reactibot
reactibot2w ago
This thread hasn’t had any activity in 72 hours, so it’s now locked. Threads are closed automatically after 72 hours. If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/565213527673929729/1410333808242327612

Did you find this page helpful?