Coder Social home page Coder Social logo

simple-web-worker's Introduction

Olá! 👋

Bem-vindo(a) à minha página no GitHub! 🤝

Gmail Shield GitHub Shield LinkedIn Shield

bounties4.com/@/israelss

🔧 Tecnologias e ferramentas que eu conheço:

Base CSS3 Shield HTML5 Shield JavaScript Shield TypeScript Shield Git Shield Conventional Commits Shield
BackEnd NodeJS Shield ExpressJS Shield TS-Node Shield JWT Shield NestJS Shield
FrontEnd React Shield React Router Shield Redux Shield
FullStack NextJS Shield Remix Shield
Databases Prisma Shield PostgreSQL Shield MySQL Shield MongoDB Shield
Styling TailwindCSS Shield Bootstrap Shield
Testing Jest Shield Mocha Shield Chai Shield Vitest Shield Testing_Library Shield Playwright Shield
Other Python Shield Docker Shield JSON Shield Vite Shield Markdown Shield NPM Shield Yarn Shield
LEARNING SKILL

📋 Esse é um resumo das minhas atividades:

Powered by: GitHub Readme Stats

🌎 Onde estou agora?

Atualmente estou morando no Brasil, e trabalho na ZapVoice como Desenvolvedor FullStack.

📚 O que estou aprendendo?

Estou aprofundando o conhecimento sobre NestJs/React/Node e iniciando os estudos de Java

Se você sabe algo sobre Qwik, por favor, conte-me! Qwik está na minha lista "o que aprender em seguida"!

✅ Abaixo você pode ver quais são meus melhores repositórios (ou pelo menos os que eu tenho mais orgulho 😅) :

simple-web-worker's People

Contributors

anonmos avatar israelss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

simple-web-worker's Issues

Importing functions from different files

I want to use a function that I import from another file but that gives my webpack errors during runtime: Uncaught ReferenceError: _helpers_harmonic__WEBPACK_IMPORTED_MODULE_12__ is not defined.

Is there a way to do this? My workaround is now to copy the function into the web worker target function. Obviously not very DRY...

Usage with Webpack in Production

Is there any trick or config I need to do to get this working in production builds with webpack? It works fine in development but it appears that it does not survive the build afterwards.

Since you can't pass a library or function to the run function, is there a way to import it inside the run function?

I tried this:

Worker.run(async (batchPatch) => {
    const { useBatchesApi } = await import("@/hooks/useBatches")
    const { update } = useBatchesApi()
    return update(batchPatch)
  }, [batchPatch])
  .then(console.log)
  .catch(console.error)

But then I get Failed to resolve module specifier '/src/hooks/useBatches.ts?t=1649663469345'. I've been trying for hours now just to make the update method work. Please tell me there's a way to do this.

run can not execute async function

when i wan to fetch in worker run,it doesn't work。
such as:
worker.run(() => { fetch('https://github.com/israelss/simple-web-worker/issues/new') })
It be closed, but fetching response has not return

DOMException: Failed to execute 'postMessage' on 'Worker': function (a, b, c) {

Hi
So thanks by the repo, it's great!!
I can't run the code, it throw me:

DOMException: Failed to execute 'postMessage' on 'Worker': function (a, b, c) {
        if (this instanceof C) {
          switch (arguments.length) {
            case 0:...<omitted>... } could not be cloned.

And my code it's this:

    worker.run(() => {
      if ('indexedDB' in self) {
        return new Promise((resolve, reject) => {
          var openRequest = indexedDB.open('database', 1)
          var db

          openRequest.onsuccess = (event) => {
            db = openRequest.result
            console.log(db)
            getData(db)
          }
          function getData(db) {
            var transaction = db.transaction(['database'], 'readwrite')
            var objectStore = transaction.objectStore('database')

            var objectStoreRequest = objectStore.get('entries')

            objectStoreRequest.onsuccess = function(event) {
              console.log((objectStoreRequest.result))
              resolve(objectStoreRequest.result)
            }
            objectStore.onerror = function(event) {
              reject(transaction.error)
            }
          }
        })
      }
    })
      .then(console.log)
      .catch(console.log)

Any idea?
Thanks

Edit: I have to send 'Promise', cause webpack transform 'Promise'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.