SyncedObservableOptions<T>
Defined in: src/lib/observable/types.ts:250
Options for synchronized observables (serverOwned, clientOwned, shared).
Extends
Extended by
Type Parameters
| Type Parameter |
|---|
T |
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
broadcast? | boolean | If true, all connected players are automatically subscribed. If false (default), players must be manually subscribed. Default false | ObservableOptions.broadcast | src/lib/observable/types.ts:63 |
equals? | (a: T, b: T) => boolean | Custom equality function to determine if value has changed. Defaults to strict equality (===). | ObservableOptions.equals | src/lib/observable/types.ts:73 |
id | string | Unique identifier for this observable. Used for RPC event naming and debugging. Format: "moduleName:observableName" | ObservableOptions.id | src/lib/observable/types.ts:50 |
initialValue | T | Initial value of the observable. | ObservableOptions.initialValue | src/lib/observable/types.ts:55 |
noResponse? | boolean | If true, use fire-and-forget mode for sync updates. Faster but no guarantee of delivery. Default true | - | src/lib/observable/types.ts:257 |
perPlayer? | boolean | If true, this observable is per-player (each player has their own value). - On server: Multiple instances can exist with the same base ID. Use subscribePlayer(playerId) to subscribe and sync to a specific player. - On client: The observable automatically receives values sent to this client. No need to know the player's server ID. The sync event name uses the base ID (without player ID suffix), and FiveM's emitNet targets the specific player. Default false | - | src/lib/observable/types.ts:272 |
syncDebounceMs? | number | Debounce sync updates by this many milliseconds. Useful for frequently changing values. Default 0 (no debounce) | ObservableOptions.syncDebounceMs | src/lib/observable/types.ts:81 |