Prevent unneccessary re-renders

This commit is contained in:
Thomas Nordquist
2019-06-06 23:15:12 +02:00
parent 15a0c8a5c5
commit e728a721aa
5 changed files with 81 additions and 102 deletions

View File

@@ -62,6 +62,10 @@ export class RingBuffer<T extends Lengthwise> {
return this.items.slice(this.start, this.end)
}
public count() {
return this.end - this.start
}
public add(item: T) {
const size = item.length
this.enforceCapacityConstraints(size)