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

163
Visualizações
how do I use useCallback hook in svelte

This is my code block looks line when used with a useCallback hook in react but I want to use same function in svelte,but want to add this in useCallback hook. Is there any alternative for svelte.

const newCancelToken = useCallback(() => {
        axiosSource.current = axios.CancelToken.source();
        return axiosSource.current.token;
    }, []);
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Keep that in mind: The way svelte processes its components is very different from react.

React re-renders all components any time any state within a component, or anywhere in a parent, changes. To avoid the re-computation you will need the use of useMemo or useCallback in your case.

Svelte is a compiler and analyzes your template to create targeted DOM update code whenever any concerned state changes. With that in mind, you don't need to memoize such functions with svelte.

about 4 years ago · Juan Pablo Isaza Relatório
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