docs: Add example for event bus listener usage in README and documentation
This commit is contained in:
parent
3cadcce32a
commit
67ab1d744c
@ -78,6 +78,10 @@ Client sync and notification requests:
|
|||||||
- `locker.va.sync.requested`
|
- `locker.va.sync.requested`
|
||||||
- `garage.vgarage.sync.requested`
|
- `garage.vgarage.sync.requested`
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
Register a listener, emit an event, then remove the listener when it is no longer needed:
|
||||||
|
|
||||||
```sqf
|
```sqf
|
||||||
private _token = EGVAR(common,EventBus) call ["on", [
|
private _token = EGVAR(common,EventBus) call ["on", [
|
||||||
"task.completed",
|
"task.completed",
|
||||||
|
|||||||
@ -76,6 +76,10 @@ Client sync and notification requests:
|
|||||||
- `locker.va.sync.requested`
|
- `locker.va.sync.requested`
|
||||||
- `garage.vgarage.sync.requested`
|
- `garage.vgarage.sync.requested`
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
Register a listener, emit an event, then remove the listener when it is no longer needed:
|
||||||
|
|
||||||
```sqf
|
```sqf
|
||||||
private _token = EGVAR(common,EventBus) call ["on", [
|
private _token = EGVAR(common,EventBus) call ["on", [
|
||||||
"task.completed",
|
"task.completed",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user