OLD | NEW |
---|---|
(Empty) | |
1 self.onmessage = function(e) { | |
2 var port = e.data.port; | |
3 var message = []; | |
4 | |
5 // 1st matchAll() | |
6 self.clients.matchAll() | |
7 .then(function(clients) { | |
8 clients.forEach(function(client) { | |
9 message.push(client.id); | |
10 }); | |
11 }) | |
12 .then(function() { | |
falken
2015/06/25 04:09:56
why is this a new function, it looks like the prev
jungkees
2015/06/25 07:48:37
The first forEach implicitly returns undefined, bu
| |
13 // 2nd matchAll() | |
14 return self.clients.matchAll().then(function(clients) { | |
15 clients.forEach(function(client) { | |
16 message.push(client.id); | |
17 }); | |
18 }); | |
19 }) | |
20 .then(function() { | |
21 // Send an array containing ids of clients from 1st and 2nd matchAll() | |
22 port.postMessage(message); | |
23 }); | |
24 }; | |
OLD | NEW |