# Callback `[Server]`

A module to use callback module server side

## JO Functions

### jo.callback.registerCallback()

A function to register a server callback <br>

#### Syntax

```lua
jo.callback.registerCallback(name, cb, latent)
```

#### Parameters

`name` : _string_
> The name of the callback event
>

`cb` : _function_
> The function executed when the callback is triggered <br> ⚠️ `source` is always the first argument
>

---

### jo.callback.registerLatentCallback()

A function to register a latent server callback <br>

#### Syntax

```lua
jo.callback.registerLatentCallback(name, cb)
```

#### Parameters

`name` : _string_
> The name of the callback event
>

`cb` : _function_
> The function executed when the callback is triggered <br> ⚠️ `source` is always the first argument
>

---

### jo.callback.triggerClient()

A function to trigger a client callback <br>

#### Syntax

```lua
jo.callback.triggerClient(name, source, cb, ...)
```

#### Parameters

`name` : _string_
> The name of the callback event
>

`source` : _integer_
> The source of the client to trigger
>

`cb` : _function_ `[Optional]`
> Function to receive the result of the event
>

`...` : _any_ `[Optional]`
> The list of parameters to send to the callback event
>

---

### jo.callback.triggerServer()

A function to trigger a server callback <br>

#### Syntax

```lua
jo.callback.triggerServer(name, cb, ...)
```

#### Parameters

`name` : _string_
> Name of the callback event
>

`cb` : _function_ `[Optional]`
> Function to receive the result of the event
>

`...` : _any_ `[Optional]`
> The list of parameters to send to the callback event
>
