Today I want to share a quick tip to keep our code neat & clean when working with Velo files such as data.js and events.js. This is especially important when building a large app on Wix.
As you know, data.js is a system file that contains all of our collections' hooks. As our project grows, the number of collections increases and the hooks count can quickly grow out of control. We end up with a hundred lines of code that are a nightmare to manage.
But as with any module, data.js, we are able to import-export whole modules at once.
Now, we have our hooks organized by collections which greatly simplify management for projects with large databases.
Having one file per collection is pretty neat don't you think?
learned one more thing today!