Skip to content
Discussion options

You must be logged in to vote

Create the services object inside main(page) and pass it to your route/view constructors. Flet 1.0's session store also provides a lookup point for modules receiving the current page:

page.session.store.set("services", services)
# Later, within the same session:
services = page.session.store.get("services")

Create separate service instances per session. Putting the same global object into two stores still shares it.

The registry example in #5903 uses this pattern across modules. The store is transient and holds references, so connection cleanup and database/httpx concurrency still need their own handling.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by LioraBrook
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
help wanted Extra attention is needed
3 participants