Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tombulled/event
Event handling
https://github.com/tombulled/event
Last synced: 23 days ago
JSON representation
Event handling
- Host: GitHub
- URL: https://github.com/tombulled/event
- Owner: tombulled
- License: mit
- Created: 2021-11-07T18:29:16.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-02T21:26:37.000Z (over 2 years ago)
- Last Synced: 2023-03-05T18:53:57.018Z (almost 2 years ago)
- Language: Python
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# event
Event handling## Usage
### Basic
```python
import event@event.on("alert")
def on_alert():
print("Alert!")
``````python
>>> event.dispatch("alert")
Alert!
```### Standard
```python
import eventhandler = event.Handler()
@handler.on("login")
def on_login(username: str):
print(f"Logged in as {username}")
``````python
>>> handler.dispatch("login", username="admin")
Logged in as admin
```