Add values
.
This commit is contained in:
parent
f07e849662
commit
b9901df29a
3 changed files with 46 additions and 31 deletions
12
lib/index.js
12
lib/index.js
|
@ -241,7 +241,17 @@ const Channel = function(bufferLength = 0) {
|
|||
}
|
||||
},
|
||||
|
||||
toString: () => `Channel(${bufferLength})`
|
||||
toString: () => `Channel(${bufferLength})`,
|
||||
|
||||
values: async () => {
|
||||
const array = [];
|
||||
|
||||
await readOnly.forEach(item => {
|
||||
array.push(item);
|
||||
});
|
||||
|
||||
return array;
|
||||
}
|
||||
});
|
||||
|
||||
Object.defineProperty(readOnly, `value`, { get: () => lastValue });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue