Hello I have this function in app.js
const LOLTrackingSystem = setInterval(async () => {
await LOLUserData.LOLUserData(3, async (result) => { // [Step (2)]
await summonerStats.summonerStats (result , async (result) => { // [Step (3)]
await addPointsToUser.addPointsToUser(result) // [Step (4)] Final
})
})
}, 2000);
working fine but I want to put the function in separate file and export it and use it in app.js here is what I have done
LOLTracking.js
//=============================================================================
// LOL Ranked Games Wins Tracking System
//=============================================================================
const LOLUserData = require('../leagueOfLegends/getUserData')
const summonerStats = require('../leagueOfLegends/getSummonerStats')
const addPointsToUser = require('../gizmo/addPoints')
const LOLTrackingSystem = setInterval(async () => {
await LOLUserData.LOLUserData(3, async (result) => { // [Step (2)]
await summonerStats.summonerStats (result , async (result) => { // [Step (3)]
await addPointsToUser.addPointsToUser(result) // [Step (4)] Final
})
})
}, 2000);
exports.LOLTrackingSystem = LOLTrackingSystem
but now when i require it and use it in my app.js like this
const LOLTrackingSystem = require('./src/methods/onlineGamesTracking/LOLTracking')
const run = async () => {
await LOLTrackingSystem.LOLTrackingSystem()
}
run()
I get an error saying
TypeError: LOLTrackingSystem.LOLTrackingSystem is not a function
what am I doing wrong?