@studiokeywi/banjo - v0.0.1
    Preparing search index...

    Interface PoolConfig<Type, InitArgs>

    Configuration to provide a new object pool

    interface PoolConfig<Type extends object, InitArgs extends unknown[]> {
        init: (this: Pooled<Type>, ...args: InitArgs) => void;
        reset: (this: Type) => void;
        size: number;
        spawn: () => Type;
    }

    Type Parameters

    • Type extends object

      The type of objects contained within the pool

    • InitArgs extends unknown[]

      Arguments provided when initializing a pool object

    Index

    Properties

    Properties

    init: (this: Pooled<Type>, ...args: InitArgs) => void

    Initializer logic when reusing a pooled object

    Type declaration

    reset: (this: Type) => void

    Reset logic when returning a pooled object

    size: number

    The total size of the object pool

    spawn: () => Type

    Spawning logic when creating the object pool