Skip to content

Commit

Permalink
Merge pull request #95 from knowhere01/master
Browse files Browse the repository at this point in the history
Events not working as expected
  • Loading branch information
rlaphoenix authored Apr 5, 2024
2 parents 994ab15 + e92f8ed commit b7ea94d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ Please refrain from spam or asking for questions that infringe upon a Service's
<a href="https://github.com/varyg1001"><img src="https://images.weserv.nl/?url=avatars.githubusercontent.com/u/88599103?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="varyg1001"/></a>
<a href="https://github.com/Hollander-1908"><img src="https://images.weserv.nl/?url=avatars.githubusercontent.com/u/93162595?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Hollander-1908"/></a>
<a href="https://github.com/Shivelight"><img src="https://images.weserv.nl/?url=avatars.githubusercontent.com/u/20620780?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Shivelight"/></a>
<a href="https://github.com/knowhere01"><img src="https://images.weserv.nl/?url=avatars.githubusercontent.com/u/113712042?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="knowhere01"/></a>

## Licensing

Expand Down
4 changes: 3 additions & 1 deletion devine/core/events.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

from copy import deepcopy
from enum import Enum
from typing import Any, Callable

Expand All @@ -25,10 +26,11 @@ def __init__(self):

def reset(self):
"""Reset Event Observer clearing all Subscriptions."""
self.__subscriptions = self.__ephemeral = {
self.__subscriptions = {
k: []
for k in Events.Types.__members__.values()
}
self.__ephemeral = deepcopy(self.__subscriptions)

def subscribe(self, event_type: Events.Types, callback: Callable, ephemeral: bool = False) -> None:
"""
Expand Down

0 comments on commit b7ea94d

Please sign in to comment.