PowerHorse Engine
    Preparing search index...

    Class Cache<K, V>

    Type Parameters

    • K extends unknown[]
    • V

    Hierarchy (View Summary)

    Index

    Constructors

    • Type Parameters

      • K extends unknown[]
      • V

      Parameters

      • FetchFunction: (...args: K) => V

      Returns Cache<K, V>

    Properties

    _classNames: string[]
    _dev: {
        _internal_runtime_debug_info: { creationTimestamp: number };
        get: (targetItem: string | number) => unknown;
        has: (targetItem: unknown) => boolean;
        insert: (item: unknown) => void;
        set: (targetItem: string | number, targetValue: unknown) => void;
        [key: string | number | symbol]: unknown;
    } & UnknownArray

    A unique container where items about the pseudo should be stored. Anything within this container will be destroyed/cleaned up whenever the pseudo is destroyed. (Good for storing Servants,Maids,etc.)

    _G: UnknownArray & {
        get: <T>(key: unknown, timeout?: number) => Promise<T>;
        set: (key: unknown, value: unknown) => void;
    }
    _id: string

    Unique identifier for the Pseudo.

    Use GetIdAsync() over _id.

    $client:
        | undefined
        | (
            (
                initializedServant: ServantNext,
                PseudoClientReplicator: PseudoClientReplicator,
            ) => void | (() => void)
        )
    $server:
        | undefined
        | (
            (
                initializedServant: ServantNext,
                PseudoClientReplicator: PseudoClientReplicator,
            ) => void | (() => void)
        )
    AutoClearExpiredCacheInterval: number = -1

    Will automatically clear expired data after the set interval.

    Set to -1 to disable.

    CacheLifetime: number = 10

    How long each cached item will exist before it is considered expired.

    ClassName: string

    The ClassName of the Pseudo

    Destroying: Signal

    Fired when the Pseudo is being destroyed.

    Name: string

    The Name of the Pseudo

    Parent: undefined | Instance | PseudoNext<unknown, Folder>

    The parent of the pseudo object

    PrePropertyChanged: Signal<(Key: unknown, Value: unknown) => void>
    PropertyChanged: Signal<(Key: unknown, Value: unknown) => void>
    Replicator: PseudoReplicator

    NOTE: Using the Replicator on the client can lead based on the current status of the Replicator.

    Methods

    • Gets the currently assigned properties of the pseudo

      Parameters

      • OptionalexcludeKeys: unknown[]

        Will not include the given keys, think of it as a blacklist filter.

      • OptionalIncludeHiddenProps: boolean

        Hidden props are considered properties that begin with _

      • OptionalIncludeFunctions: boolean

        Both methods and callbacks are considered functions. (NOTE: functions by classes that inherit pseudo cannot be read, only Pseudo functions will exist. )

      • OptionalIncludeSignals: boolean

        Will include RBXScriptSignals and some third party library signals, if item has a ClassName of Signal | RBXScriptSignal it will be considered a signal.

      • OptionalAsDictionary: boolean

        Returns the objects as a dictionary with their values.

      Returns unknown[] | Record<string | number, unknown>

    • Parameters

      • condition: unknown
      • Optionalerr: unknown

      Returns asserts condition

    • Creates the signal only when it is required. Use GetSignal if you wish to create the signal.

      Parameters

      • SignalName: string

      Returns void

    • Parameters

      • Optionalfilter: string[]
      • OptionalfilterType: RaycastFilterType

      Returns void

    • Parameters

      • err: unknown
      • Optionallevel: number

      Returns never

    • Returns the cached value.

      Parameters

      • KeyId: string

      Returns undefined | V

    • Parameters

      • PropertyName: string

      Returns Signal<(Value: unknown) => void>

    • Returns the reference instance of the pseudo

      The reference Instance will not exist prior to the first call of this method for optimization sake.

      Type Parameters

      • T = Folder

      Returns T

    • Returns the ID of the Server Pseudo that it Replicates. On the Server, it will always be the same as GetIdAsync(). But on the client it will be the ID of the Server Pseudo. On the client, this function will return nil if the Pseudo was not Replicated or it didn't extend a Pseudo class initially.

      Returns undefined | string

    • Creates the signal if it doesn't exist, Gurantees the signal will exist at this point in time and be returned.

      Type Parameters

      • T extends Callback

      Parameters

      • SignalName: string

      Returns Signal<T>

    • Parameters

      • SignalName: string

      Returns boolean

      If the signal exists/will exist if indexed.

    • Parameters

      • KeyId: string
      • Value: V
      • OptionalLifetime: number

      Returns void

    • Parameters

      • Property: unknown
      • Value: unknown

      Returns void

    • Similar to useMappingEffect but is two way. meaning both this and Dependencies will always have the same Properties.

      useMappingEffect: Property of this changes - Updates dependencies useBindingEffect: Property of this changes - Updates dependencies && Property of a dependency changes - Updates this.

      Parameters

      Returns ServantNext

    • Run a function whenever Pseudo is being Destroyed

      It is recommended to use the .Destroying event over this method as it is slower.

      Parameters

      • callback: Callback

      Returns ServantNext

      Sevant

    • Parameters

      • callback: (key: unknown, value: unknown) => unknown

      Returns void

    • Parameters

      • key: unknown
      • value: unknown

      Returns void