I updated my comment reply because the object approach does work. Although the library does have some other really cool features like easy ways to iterate over the enum.
That could be useful, though I haven't really needed enums in recent times so maybe there is something for that as well?
Either way, glad you learned something new! :D
To be fair, I had to look it up a bit as I've only used enums a handful of times on my TS projects so far so I was unfamiliar but I was pretty sure that this was an existing feature. Basically what I'm trying to say is that I too learned this. :P
Yea I recently had to iterate over an enum for a React project and its basically a giant headache. So when you need to do it it’s nice to have a library to reduce the headache haha.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I updated my comment reply because the object approach does work. Although the library does have some other really cool features like easy ways to iterate over the enum.
That could be useful, though I haven't really needed enums in recent times so maybe there is something for that as well?
Either way, glad you learned something new! :D
To be fair, I had to look it up a bit as I've only used enums a handful of times on my TS projects so far so I was unfamiliar but I was pretty sure that this was an existing feature. Basically what I'm trying to say is that I too learned this. :P
Yea I recently had to iterate over an enum for a React project and its basically a giant headache. So when you need to do it it’s nice to have a library to reduce the headache haha.