Skip to content

Commit

Permalink
sistana: feat: ConstraintRx
Browse files Browse the repository at this point in the history
  • Loading branch information
GreyElaina committed Sep 20, 2024
1 parent 9cdfd3b commit b29f17c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/arclet/alconna/sistana/model/receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,13 @@ def receive(self, get: RxGet[list[T]], put: RxPut[list[T]], data: T) -> None:
put([data])
else:
put([*v.value, data])


class ConstraintRx(Generic[T], Rx[Any]):
value: T

def __init__(self, value: T):
self.value = value

def receive(self, get: RxGet[Any], put: RxPut[T], data: Any) -> None:
put(self.value)

0 comments on commit b29f17c

Please sign in to comment.