UNPKG
bot-io
Version:
latest (1.0.2)
1.0.2
1.0.1
1.0.0
0.1.1
0.1.0
ADC, GPIO, PWM, UARTs, and more on the BeagleBone Black.
github.com/fivdi/bot-io
fivdi/bot-io
bot-io
/
lib
/
eeutil.js
16 lines
(12 loc)
•
275 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
'use strict'
;
module
.
exports
.
once
=
function
(
event, emitters, listener
) {
var
count = emitters.
length
; emitters.
forEach
(
function
(
emitter
) { emitter.
once
(event,
function
(
) { count -=
1
;
if
(count ===
0
) {
listener
(); } }); }); };