Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/deebloo/worker
Browse files Browse the repository at this point in the history
  • Loading branch information
Danny Blue committed May 23, 2016
2 parents 20bb75f + 71aed1a commit 758f9d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ var $worker = require('@deebloo/worker');
// if using as global
var $worker = window.$worker;

// pass in a function to be run in a separate thread
var myWorker = $worker().create(function () {
self.postMessage('Hello World');
});

// run the worker respond to the promise
myWorker.run().then(function (e) {
console.log(e.data); // 'Hello World'
});
Expand Down Expand Up @@ -92,4 +94,4 @@ workerGroup.create( ... );
workerGroup.create( ... );

workerGroup.list().length === 2
```
```

0 comments on commit 758f9d7

Please sign in to comment.