-
Notifications
You must be signed in to change notification settings - Fork 1
API Client
Client-side PlayerState API for data access and change listeners.
Get(key) → any
Gets a top-level data value. Automatically waits for data to load with built-in caching for performance.
Parameters: key: string
Returns: any - The value, or nil if not found
GetPath(path) → any
Gets a nested data value using dot notation. Automatically waits for data to load with optimized nested value caching.
Parameters: path: ValuePath
Returns: any - The value, or nil if not found
GetAll() → PlayerData?
Gets all player data. Automatically waits for data to load.
Parameters: None
Returns: PlayerData? - Complete data table, or nil if not loaded
GetFromDict(dictPath, key) → any
Gets a value from a dictionary using a key with automatic type conversion and caching.
Parameters: dictPath: ValuePath, key: string | number
Returns: any - The value, or nil if not found
IsReady() → boolean
Checks if player data is ready and replica is active.
Parameters: None
Returns: boolean - True if data is ready, false otherwise
ClearCache() → void
Manually clears all internal caches. Useful for memory management or debugging.
Parameters: None
Returns: Nothing
OnChanged(pathOrKey, callback) → ReplicaClient.Connection?
Listens for changes to a specific data path or key with enhanced change information.
Parameters: pathOrKey: string, callback: (newValue: any, oldValue: any, changeInfo: ChangeInfo | {string}?) -> ()
Returns: ReplicaClient.Connection? - Connection to disconnect the listener
GetReplica() → ReplicaInstance?
Gets the raw Replica instance for advanced operations.
Parameters: None
Returns: ReplicaInstance? - Replica instance, or nil if not loaded