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

161
Vistas
How to share a variable between files when using Electron?

I broke the whole application into components. And the problem is that I need to select an option in one component and use it (display, for example) in another component. Of course, the value could be changed anytime so the diplay component should have the lates one.

select component

const selectTemplate = (state) => `
    <input list="currecyList" id="selects" placeholder="USD">
    <datalist id="currecyList">
        ${state.list}
    </datalist>
`;

script file for the select component

let value;
const inp = document.querySelector("#selects");
inp.addEventListener("change", (event) => {
    console.log(event.target.value);
    value = event.target.value;
});

display component

const displayTemplate = (state) => `
  <header>
    <h1>
      <a href="#/posts">${state.currency}'s Blog</a>
    </h1>
  </header>
`;
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