Add values.

This commit is contained in:
David Braun 2017-10-18 14:38:35 -04:00
parent f07e849662
commit b9901df29a
3 changed files with 46 additions and 31 deletions

View file

@ -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 });