TheQwertiest / CaTRoX_QWR

foobar2000 CUI theme
https://theqwertiest.github.io/CaTRoX_QWR/
105 stars 6 forks source link

create Properties class #5

Closed kbuffington closed 6 years ago

kbuffington commented 6 years ago

This method is just ridiculously convenient, and I wanted to use it elsewhere so I didn't have to put my theme's properties in Common.js.

TheQwertiest commented 6 years ago

The secondary aim of this object is to avoid property name collisions, which is achieved by having only a single global g_properties. If you create several objects of this type, you lose this functionality.

kbuffington commented 6 years ago

Good point, I'd overlooked that. What about creating a Properties singleton? I'm thinking something like this pattern: https://stackoverflow.com/a/4842961/911192

Everything would share the same underlying object in that case, but it could be referenced elsewhere using different object names.

TheQwertiest commented 6 years ago

What about creating a Properties singleton?

Sure, why not? =)

TheQwertiest commented 6 years ago

See https://github.com/TheQwertiest/CaTRoX_QWR/commit/0fb78bfede97d41f23cbc5e56a1aabd4f23aa74a