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

154
Visualizações
Where/How to do heavy processing in React Native

I am building a React Native/Expo App and I am using a lexicon module (https://github.com/peterolson/chinese-lexicon) which fetches some big files and does some heavy transformations, so it takes about 10-15 seconds to load. While loading the module, the whole app freezes.

I know that there is no multithreading in Javascript - but there has to be a way to do some heavier processing without blocking the UI, right? Where/how do I load this module without making my app freeze?

I tried to edit the module and make it return a Promise which resolves as soon as the Lexicon is loaded:

function load() {
    return new Promise((Resolve, reject) => {
        //All the code from the module
        //Calling Resolve with the loaded lexicon
    }
}
module.exports = { load }

Now I am loading the lexicon like this: require('chinese-lexicon').load().then((lexicon) => { ... });, however it is still blocking the main thread - which makes sense, as the Promise executor function itself is still running synchronously.

I also tried some tricks like using setTimeout(() => { ... }, 0) in the Promise executor function, but it's still blocking.

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