Added observables

This commit is contained in:
2023-04-15 16:17:31 +02:00
parent 8dee4d8f70
commit efc9cf9c83
11 changed files with 254 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
from cpl_core.type import T
from cpl_reactive_extensions.observable import Observable
class Subject(Observable):
def __init__(self):
Observable.__init__(self)
self._value: T = None
@property
def value(self) -> T:
return self._value
def emit(self, value: T):
self._value = value
self._subscriptions()