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`
|
||||
- `garage.vgarage.sync.requested`
|
||||
|
||||
### Example
|
||||
|
||||
Register a listener, emit an event, then remove the listener when it is no longer needed:
|
||||
|
||||
```sqf
|
||||
private _token = EGVAR(common,EventBus) call ["on", [
|
||||
"task.completed",
|
||||
|
||||
@ -76,6 +76,10 @@ Client sync and notification requests:
|
||||
- `locker.va.sync.requested`
|
||||
- `garage.vgarage.sync.requested`
|
||||
|
||||
### Example
|
||||
|
||||
Register a listener, emit an event, then remove the listener when it is no longer needed:
|
||||
|
||||
```sqf
|
||||
private _token = EGVAR(common,EventBus) call ["on", [
|
||||
"task.completed",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user