ex4nicegui
ex4nicegui copied to clipboard
Using the ref computed decorator causes some properties to become inaccessible.
from dataclasses import dataclass, field
from ex4nicegui import to_ref, ref_computed, deep_ref, Ref
@dataclass
class State:
todos: Ref = field(default_factory=lambda: deep_ref([]))
filter_do = to_ref("all")
@ref_computed
def filtered_todos(self):
return 10
s = State()
s.todos.value
error:
AttributeError: 'State' object has no attribute 'todos'