pyflix: add passing event name to off method

This commit is contained in:
Oleg Kalachev
2025-10-03 06:46:29 +03:00
parent 6e6a71fa69
commit b3dffe99fb
2 changed files with 16 additions and 4 deletions

View File

@@ -59,6 +59,13 @@ flix.on('disconnected', lambda: print('Disconnected from Flix'))
flix.on('print', lambda text: print(f'Flix says: {text}'))
```
Unsubscribe from events using `off` method:
```python
flix.off('print') # unsubscribe from print events
flix.off(callback) # unsubscribe specific callback
```
You can also wait for specific events using `wait` method. This method returns the data associated with the event:
```python