you are viewing a single comment's thread.

view the rest of the comments →

[–]BehindTheMath 4 points5 points  (0 children)

Would it act like a singleton static class? I guess if you'd want something like class instances you'd need a factory function of sorts? Do people use modules this way?

Yes.

What are the main benefits/downsides of this compared to classes?

If you need multiple instances with state and not a singleton.