useWorker icon indicating copy to clipboard operation
useWorker copied to clipboard

how inject dependence for worker function

Open QC2168 opened this issue 1 year ago • 0 comments

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);
}

QC2168 avatar Aug 07 '22 14:08 QC2168