developit/workerize

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

Open

#26 建立於 2018年3月20日

在 GitHub 查看
 (4 留言) (0 反應) (0 負責人)JavaScript (113 fork)batch import
enhancementhelp wanted

倉庫指標

Star
 (4,299 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

	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.

貢獻者指南