How would one go about importing ‘singleton’ services / objects.
For instance, importing jquery. One would probably want to do that only once. Would this mean importing in the ‘main’ js file and then just using $
everywhere else?
If I had, for example, a SecurityService
that I wanted to instantiate only once would I also import, say, and instance from the relevant module
and then use the given imported name, like so?:
import securityService from 'src/services/security';
Am I on the right track?>