developit/workerize

Consider removing expose(), call() and kill() ?

Open

#26 aperta il 20 mar 2018

Vedi su GitHub
 (4 commenti) (0 reazioni) (0 assegnatari)JavaScript (113 fork)batch import
enhancementhelp wanted

Metriche repository

Star
 (4299 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

	worker.expose = methodName => {
		worker[i] = function() {
			return worker.call(methodName, [].slice.call(arguments));
		};
	};

Instead methodName parameter should be used:

	worker.expose = methodName => {
		worker[methodName] = function() {
			return worker.call(methodName, [].slice.call(arguments));
		};
	};

Beside that I don't see why the call and expose methods are accessible from outside. (Don't assign to worker at all) The purpose of the kill method is also not clear for me.

Guida contributor