mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-02 06:28:54 +00:00
refactor: Add h1 headers to all pages missing it (#137)
* refactor: Add h1 headers to all pages missing it * refactor: missed example h3 * change hooks example heading to bold text --------- Co-authored-by: Luke <[email protected]>
This commit is contained in:
1 parent
74227cc262
commit
1d2c490b26
95 files changed
+2167
-2289
No files matched your search
@@ -1,9 +1,11 @@
|
||||
import { Tabs, Tab } from 'nextra-theme-docs';
|
||||
|
||||
# Client
|
||||
|
||||
Caches data related to the player.
|
||||
An interval runs every 100ms to update data that cannot be checked via handlers.
|
||||
|
||||
## States
|
||||
## Cache States
|
||||
|
||||
- ped: `number`
|
||||
- player entity id
|
||||
@@ -31,47 +33,48 @@ An interval runs every 100ms to update data that cannot be checked via handlers.
|
||||
Register an event handler that is triggered when the cached value is updated.
|
||||
|
||||
<Tabs items={["Lua", "JS"]}>
|
||||
<Tab>
|
||||
<Tab>
|
||||
```lua
|
||||
lib.onCache(key, function(value) end)
|
||||
```
|
||||
|
||||
```lua
|
||||
lib.onCache(key, function(value) end)
|
||||
```
|
||||
- key: `string`
|
||||
- `ped`
|
||||
- `vehicle`
|
||||
- `seat`
|
||||
- `weapon`
|
||||
- `mount` (RedM only)
|
||||
- value: `any`
|
||||
|
||||
- key: `string`
|
||||
- `ped`
|
||||
- `vehicle`
|
||||
- `seat`
|
||||
- `weapon`
|
||||
- `mount` (RedM only)
|
||||
- value: `any`
|
||||
```lua
|
||||
lib.onCache('vehicle', function(value)
|
||||
print('old vehicle:', cache.vehicle)
|
||||
print('new vehicle:', value)
|
||||
end)
|
||||
```
|
||||
</Tab>
|
||||
<Tab>
|
||||
```ts
|
||||
import { onCache } from '@overextended/ox_lib/client';
|
||||
|
||||
```lua
|
||||
lib.onCache('vehicle', function(value)
|
||||
print('old vehicle:', cache.vehicle)
|
||||
print('new vehicle:', value)
|
||||
end)
|
||||
```
|
||||
onCache(key, (value) => {});
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab>
|
||||
- key: `string`
|
||||
- `ped`
|
||||
- `vehicle`
|
||||
- `seat`
|
||||
- `weapon`
|
||||
- `mount` (RedM only)
|
||||
- value: `any`
|
||||
|
||||
```ts
|
||||
import { onCache } from '@overextended/ox_lib/client';
|
||||
```ts
|
||||
import { cache, onCache } from '@overextended/ox_lib/client';
|
||||
|
||||
onCache(key, (value) => {});
|
||||
```
|
||||
|
||||
- key: `string`
|
||||
- value: `any`
|
||||
|
||||
```ts
|
||||
import { cache, onCache } from '@overextended/ox_lib/client';
|
||||
|
||||
lib.onCache('vehicle', (value) => {
|
||||
console.log('old vehicle:', cache.vehicle);
|
||||
console.log('new vehicle:', value);
|
||||
});
|
||||
```
|
||||
|
||||
</Tab>
|
||||
lib.onCache('vehicle', (value) => {
|
||||
console.log('old vehicle:', cache.vehicle);
|
||||
console.log('new vehicle:', value);
|
||||
});
|
||||
```
|
||||
</Tab>
|
||||
</Tabs>
|
||||
Reference in new issue
Block a user