瀏覽代碼

add yield state in main app lifespan (#3097)

Co-authored-by: JR <romain.jouhameau@icebergdatalab.com>
RomainEconomics 1 年之前
父節點
當前提交
18ea92df92
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      nicegui/ui_run_with.py

+ 2 - 2
nicegui/ui_run_with.py

@@ -68,8 +68,8 @@ def run_with(
     @asynccontextmanager
     async def lifespan_wrapper(app):
         await _startup()
-        async with main_app_lifespan(app):
-            yield
+        async with main_app_lifespan(app) as state:
+            yield state
         await _shutdown()
 
     app.router.lifespan_context = lifespan_wrapper