Skip to content

Feat: Compatibility with NiceGUI bindings #13

@LeonMusCoden

Description

@LeonMusCoden

Hi,

Thank you for the package! It is already integrating nicely in my projects.
I do have one feature that would improve the DX quite a lot when working in NiceGUI apps: Having Signal and Computed be BindableProperties.

Use case example:
Currently, I'm using the following work around quite a lot:

class State:
    def __init__(self):
        self.count_text = Computed(...)

state = State()
a_label = ui.label()

_label_effect = Effect(lambda: a_label.set_text(state.count_text()))

This could be made easier with support for BindableProperties:

class State:
    def __init__(self):
        self.count_text = Computed(...)

state = State()
ui.label().bind_text_from(state.count_text)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions