Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

108
Visualizações
Short question about organization of functions with firebase

I have an index.html with the following script

<script type="module">
      import { initializeApp } from "https://www.gstatic.com/firebasejs/9.9.2/firebase-app.js";
       import { getDatabase, ref, query, orderByChild, equalTo, set, child, get, update, onValue, push, remove, onChildAdded, limitToLast} from "https://www.gstatic.com/firebasejs/9.9.2/firebase- database.js";
      import { getAuth, signInWithEmailAndPassword, createUserWithEmailAndPassword } from "https://www.gstatic.com/firebasejs/9.9.2/firebase-auth.js";

  const firebaseConfig = {....};
  const app = initializeApp(firebaseConfig);
  const db = getDatabase(app);
  const auth = getAuth();
  const dbRef = ref(db);

  var a = [1,2,3,4,5,6,7,8,9];
  var b = [9,8,7,6,5,4,3,2,1];

  function first(a){
     second(a);
     a[0] = 9;
  }

  function second(a){
    console.log(a);
  }

</script>

Functions a and b are examples, I actually have about 50 different functions. I would like to know how to organize them into groups of functions that perform or have the same objective. I have tried imports but if I change any part of the code I have to update the cache (?v=1.0 example) in all the other files that import that function.

Is there any way to simplify it? How is the most efficient way to work with various functions and connections to firebase from js?

If I dont have the firebase module, I would simply include several js scripts with the functions bundled

I also want the variables declared in the main script to be able to be modified by the group of functions that I want to load externally to have the functions separated and organized

anything would help me Thank you

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda