of<T extends Pooled<T>> static method

T of<T extends Pooled<T>>(
  1. CreatePooled<T> createPooled
)

Creates a new Pooled of type T.

The instance created with createPooled should be created with a zero-argument contructor because it will only be called once. All fields of the created object should be set in the calling factory constructor.

Implementation

static T of<T extends Pooled<T>>(CreatePooled<T> createPooled) =>
    ObjectPool.get<T>(createPooled);