useWorker
useWorker copied to clipboard
how inject dependence for worker function
I have a dependency property in a function that depends on methods in other modules. I found the localDependency property in the documentation, but it does not solve my problem. So I checked the source code of the useWorker and found that the localDependency property is commented out
// e.g
import {
diff
} from '@/utils';
import { getConfig } from '@/config';
// my worker function
export default function foo(arr,arr2){
// error, it does not work
// diff is not defined
return diff(arr,arr2);
}