N
Nuxt2y ago
Muse

Where should I put a global stateless helper function?

If I need to create a simple function to build the base path of my application, which makes it necessary to be accessible throughout the whole application, where would it be most suitable? In the /plugins or /utils folder? Do I define it as a new plugin? Something like:
export const buildBasePath = () => { return `my/app/`; };
export const buildBasePath = () => { return `my/app/`; };
And then I will call this inside the script tags to construct URLs and programmatically navigate to other pages.
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server