vue-worker icon indicating copy to clipboard operation
vue-worker copied to clipboard

how to pass an external function to the worker?

Open Kaa10 opened this issue 5 years ago • 6 comments

Currently I would like to know if it is possible: Scenario, have two functions; The first is a generic function to create workers and returns value. The second is an external function that accesses through the mixin. My question is how do I pass this mixin function as a parameter for the worker's function to execute it?

Kaa10 avatar Apr 17 '19 23:04 Kaa10

Here's how I pass functions to vue-worker in a Vue component:

const myMethod = this.myMethod; this.$worker.run(myMethod(params));

4lp avatar May 15 '20 19:05 4lp

Here's how pass functions to vue-worker in a Vue component:

const myMethod = this.myMethod; this.$worker.run(myMethod(params));

how this work as per your idea - https://github.com/israelss/vue-worker/issues/27

hamelraj89 avatar Sep 02 '20 05:09 hamelraj89

In your example in #27, try this.$worker.run(workerJob()); instead.

4lp avatar Sep 02 '20 14:09 4lp

In your example in #27, try this.$worker.run(workerJob()); instead.

woerrjob is not defined error

hamelraj89 avatar Sep 02 '20 15:09 hamelraj89

Looks like maybe a typo based on your error message. If that's not it then I'm not sure what the issue could be : /

4lp avatar Sep 02 '20 16:09 4lp

In your example in #27, try this.$worker.run(workerJob()); instead.

im getting below error ??

const workerJob= this.workerJob; this.$worker.run(workerJob());

TypeError: You should provide a function

hamelraj89 avatar Sep 03 '20 04:09 hamelraj89