Im doing new project with Sage and my js it getting pretty big now. You can see my file here https://github.com/henrikra/portfolio-flex/blob/master/assets/scripts/main.js
Is there way to separate them to different files? How do you guys organize js in your sage projects?
Well it seems like you’ve added less than 100 lines, I personally wouldn’t quite call that unwieldy quite yet.
But since you’ve created quite a few functions, you could extract those to their own file and keep
main.js pretty lean. You’d just have to make sure you are passing all variables or objects you’re using as references, as moving them to a separate file will change their scope.
Thanks you for the info. Is it possible for you to show how can I achieve this?
Give it a shot. If you can’t figure it out, explain in detail what you tried to do to get it working.
I ended up doing something like this. It’s not super clean, but works ok for now. I plan to refactor it when jumping to Sage 9