mirror of
				https://github.com/devine-dl/devine.git
				synced 2025-11-04 03:44:49 +00:00 
			
		
		
		
	fix(Events): Dereference subscription store from ephemeral store
This commit is contained in:
		
							parent
							
								
									994ab152a4
								
							
						
					
					
						commit
						5a4c1bd6a2
					
				@ -1,5 +1,6 @@
 | 
			
		||||
from __future__ import annotations
 | 
			
		||||
 | 
			
		||||
from copy import deepcopy
 | 
			
		||||
from enum import Enum
 | 
			
		||||
from typing import Any, Callable
 | 
			
		||||
 | 
			
		||||
@ -25,10 +26,11 @@ class Events:
 | 
			
		||||
 | 
			
		||||
    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:
 | 
			
		||||
        """
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user