Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

160
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!