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 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 answers
Answer question

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 Report
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!