You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
354 B
12 lines
354 B
import gamma from 'gamma'; |
|
|
|
export default function () { |
|
self.addEventListener('message',function (ev){ |
|
var startNum = parseInt(ev.data); // ev.data=4 from main.js |
|
|
|
setInterval(function () { |
|
var r = startNum / Math.random() - 1; |
|
self.postMessage([ startNum, r, gamma(r) ]); |
|
}, 500); |
|
}); |
|
};
|
|
|