iandis / isolated_worker

An isolated worker for Flutter (Isolate) and Web (Web Worker). Behaves almost the same as the compute function, except it is not a one-off worker.
MIT License
42 stars 11 forks source link

isolate_worker is not working for web #19

Closed smartaslst closed 1 year ago

smartaslst commented 1 year ago

IsolatedWorker().run(sum, 1000).then(value) { print(s) }

int sum(int a) { int s = 0; for (int i = 0; i < a; i++) { s = s + i; }

return s; }

This code is working well for mobile. But not for web. I don't use same code for both mobile and web. Please help me

alexlozdev commented 1 year ago

for web, should use JsIsolatedWorker

iandis commented 1 year ago

Closing this as you should use JsIsolatedWorker on web as mentioned above.