I have a js file exporting a bunch of functions like so.
module.exports = {
setScene : setScene,
talk1: talk1,
talk2: talk2,
talk3: talk3,
talk4: talk4,
talk5: talk5,
talk6: talk6,
talk7: talk7,
talk8: talk8,
talk9: talk9,
talk10: talk10,
talk11: talk11,
talk12: talk12,
talk13: talk13,
talk14: talk14,
talk15: talk15,
talk16: talk16,
talk17: talk17,
talk18: talk18,
talk19: talk19,
talk20: talk20,
talk21: talk21,
touchnose: touchnose,
touchchin: touchchin,
friendos: friendos,
covermouth: covermouth,
openmouth: openmouth,
pointeye: pointeye,
gameover: gameover,
wait: wait
};
in my app.js file when I require the file, Is there a way I can destructure all of the values into local variables?
const { setScene, ...wait} = require('./components/play');
I'd like to be able to call the functions in my app.js without typing in every single value in the require statement.