one way to optimize the process, which is actually already pretty fast, is to store variables with data from firebase somewhere they can be accessed if needed.
Like a middle point between calling them on every function:
function1(args) {
const data = ref('db').get()
}
function2(args) {
const data = ref('db').get()
}
and carrying them from the first function to the last one as parameters:
superfunction(argsFunc1, argsFunc2){
const data = ref('db').get();
function1(argsFunc1, data);
function2(argsFunc2, data);
}
function1(args, data) {
const data = ref('db').get()
}
function2(args, data) {
const data = ref('db').get()
}
maybe this can be done with a singleton that handles the variables and gets them from db only if they haven't been requested before (on that execution, obviously after the execution is done, data would be erased, but at least it's not local to each function)
one way to optimize the process, which is actually already pretty fast, is to store variables with data from firebase somewhere they can be accessed if needed. Like a middle point between calling them on every function:
and carrying them from the first function to the last one as parameters:
maybe this can be done with a singleton that handles the variables and gets them from db only if they haven't been requested before (on that execution, obviously after the execution is done, data would be erased, but at least it's not local to each function)