2020-01-28
1876
#react#typescript
John Reilly
13074
Jan 28, 2020 ⋅ 6 min read

Integrating web workers in a React app with Comlink

John Reilly MacGyver turned Dev 🌻❤️ TypeScript / ts-loader / fork-ts-checker-webpack-plugin / DefinitelyTyped: The Movie

Recent posts:

Migrating To Valkey From Redis

Migrating to Valkey from Redis

With Redis’ license change and the launch of Valkey 8.0 as an alternative, this guide covers key differences and migration steps.

Matteo Di Pirro
Mar 6, 2025 ⋅ 5 min read
GraphQL Vs. REST APIs: What’s The Difference Between Them

GraphQL vs. REST APIs: What’s the difference between them

Compare GraphQL vs. REST APIs in terms of flexibility, efficiency, versioning, over-fetching, under-fetching, caching, and more.

Esteban Herrera
Mar 5, 2025 ⋅ 7 min read
how to hide scrollbars with CSS

How to use CSS to hide scrollbars without impacting scrolling

Learn how to hide the scrollbar in popular web browsers by making use of modern CSS techniques, and dive into some interactive examples.

Fimber Elemuwa
Mar 4, 2025 ⋅ 10 min read

16 React component libraries and kits for improved UI

Discover 16 of the most useful React content libraries and kits, and learn how to use them in your next React app.

Chidume Nnamdi
Mar 4, 2025 ⋅ 16 min read
View all posts

2 Replies to "Integrating web workers in a React app with Comlink"

  1. Just what I was looking for!

    For those interested, this is how I got lazy loading to work without typescript:

    “`
    const worker = new Worker(‘../../pathtoWorker’, { name: ‘my-worker’, type: ‘module’ });
    const workerApi = wrap(worker)

  2. This really helps me and save my time. I like other articles too.
    One small thing to change in snippet.

    After I changed
    “`
    const total = useTakeALongTimeToAddTwoNumbers(number1, number2);
    “`
    to
    “`
    const {total} = useTakeALongTimeToAddTwoNumbers(number1, number2);
    “`

    I can avoid an error.

Leave a Reply