Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

103
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda