Skip to content
This repository has been archived by the owner on Mar 30, 2024. It is now read-only.

CloudKidStudio/Worker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Worker Build Status Dependency Status

Execute inline JavaScript with a Web Worker API polyfill.

Installation

Installation is available using Bower.

bower install cloudkid-worker

Example Usage

var workerCode = "this.onmessage = function(event)" +
"{" +
	"var data = event.data;" +
	"var returnVal = data.value * data.value;" +
	"this.postMessage(returnVal);" +
"};";

// Create the worker
var worker = cloudkid.Worker.init(workerCode);
worker.onmessage = function(e)
{
	console.log(e.data); // returns 400
};

// Start the worker.
worker.postMessage({value:20});

License

Copyright (c) 2015 CloudKid

Released under the MIT License.

About

Execute inline JavaScript with the WebWorker API polyfill

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published