UNPKG

foxts

Version:

Opinionated collection of common TypeScript utils by @SukkaW

2 lines (1 loc) 264 B
class t{constructor(t){this.createObject=t;let e=t();this.tail=e,this.head=e}get(){let t=this.head;if(t.next)this.head=t.next;else{let t=this.createObject();this.tail=t,this.head=t}return t.next=null,t}release(t){this.tail.next=t,this.tail=t}}export{t as Repool};