Skip to content

feat: effect_refreshable.on support async#294

Merged
CrystalWindSnake merged 1 commit intomainfrom
feat/async_effect_refreshable
Jul 29, 2025
Merged

feat: effect_refreshable.on support async#294
CrystalWindSnake merged 1 commit intomainfrom
feat/async_effect_refreshable

Conversation

@CrystalWindSnake
Copy link
Owner

@CrystalWindSnake CrystalWindSnake commented Jul 29, 2025

import asyncio
from nicegui import ui
from ex4nicegui import rxui, effect_refreshable


@ui.page("/")
async def index():
    count = rxui.var(0)

    def plus_one():
        count.value += 1

    # ui
    ui.button(text="click me", on_click=plus_one)

    @effect_refreshable.on(count)
    async def _():
        await asyncio.sleep(0.5)
        ui.label(f"count: {int(count.value)}")

@github-actions github-actions bot added the feature feature label Jul 29, 2025
@CrystalWindSnake CrystalWindSnake merged commit 78c01df into main Jul 29, 2025
3 checks passed
@CrystalWindSnake CrystalWindSnake deleted the feat/async_effect_refreshable branch July 29, 2025 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant