Add when alias for platypush.hook #399

Closed
opened 2024-05-07 15:29:57 +02:00 by blacklight · 0 comments
Owner

This is just a cosmetic change, but it makes scripts much more readable.

From:

from platypush import hook
from platypush.message.event.some import SomeEvent

@hook(SomeEvent)
def on_some_event(event):
  ...

To:

from platypush import when
from platypush.message.event.some import SomeEvent

@when(SomeEvent)
def on_some_event(event):
  ...
This is just a cosmetic change, but it makes scripts much more readable. From: ```python from platypush import hook from platypush.message.event.some import SomeEvent @hook(SomeEvent) def on_some_event(event): ... ``` To: ```python from platypush import when from platypush.message.event.some import SomeEvent @when(SomeEvent) def on_some_event(event): ... ```
blacklight added this to the v1.0.0 milestone 2024-05-07 15:29:57 +02:00
blacklight added the
enhancement
label 2024-05-07 15:29:57 +02:00
blacklight self-assigned this 2024-05-07 15:29:57 +02:00
blacklight added this to the core project 2024-05-07 15:29:57 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: platypush/platypush#399
No description provided.