Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to pass an external function to the worker? #20

Open
Kaa10 opened this issue Apr 17, 2019 · 6 comments
Open

how to pass an external function to the worker? #20

Kaa10 opened this issue Apr 17, 2019 · 6 comments

Comments

@Kaa10
Copy link

Kaa10 commented Apr 17, 2019

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?

@4lp
Copy link

4lp commented May 15, 2020

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

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

@hamelraj89
Copy link

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 - #27

@4lp
Copy link

4lp commented Sep 2, 2020

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

@hamelraj89
Copy link

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

woerrjob is not defined error

@4lp
Copy link

4lp commented Sep 2, 2020

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 : /

@hamelraj89
Copy link

hamelraj89 commented Sep 3, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants