Current number of objects in the pool.
The soft ceiling by which the pool is trimmed.
Protected
_Protected
_Protected
_Signals the pool to trim after a delay.
Clears out the pool.
Shortcut for toArrayAndClear();
Gives an item to the pool. If recyclable, will be added to the recycler.
Empties the pool into an array and returns it.
Trims the pool to the optional specified max (or the default).
Optional
max: numberAttempts to get an item from the pool. Returns undefined if none available.
Static
createStatic
createCreates an auto-recycled pool using the specified generator.
Optional
generator: (...args: any[]) => T
A flexible Object Pool that trims the pool down to the specified max size after a specified delay.