That `userService` example is just awful, it feels like it's trying to achieve so many things with exactly the worst options.
- Not using ES modules which is compounded by:
- Creating a random "bag of crap" as I call it by throwing all the functions into an exported object
- Can't even get static build time feedback about the functions you're calling or if they even eixst which you would if:
The better alternatives here are:
- Just have plain exported *functions* in an ES module
- If you need shared state both functions access then export a plain class in an ES module
- Not using ES modules which is compounded by: - Creating a random "bag of crap" as I call it by throwing all the functions into an exported object - Can't even get static build time feedback about the functions you're calling or if they even eixst which you would if:
The better alternatives here are:
- Just have plain exported *functions* in an ES module - If you need shared state both functions access then export a plain class in an ES module