-
-
Notifications
You must be signed in to change notification settings - Fork 775
Provide app.storage.client as a location to store volatile data which only matters for the current connection #2820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
falkoschindler
merged 29 commits into
zauberzeug:main
from
Alyxion:feature/per_session_data
Apr 9, 2024
Merged
Changes from 2 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
db6b065
Implemented app.storage.session which enables the user to store data …
Alyxion d9403b4
Merge branch 'main' into feature/per_session_data
Alyxion 3fedd36
Replaced Client.state by ObservableDict
Alyxion 8fc9208
Merge branch 'main' into feature/per_session_data
Alyxion ea8dad5
Renamed app.storage.session to app.storage.client.
Alyxion e627934
Merge remote-tracking branch 'origin/feature/per_session_data' into f…
Alyxion df3335a
Merge branch 'main' into feature/per_session_data
Alyxion 9dd4227
Exchanged quotes
Alyxion ca99fcf
Merge remote-tracking branch 'origin/feature/per_session_data' into f…
Alyxion 08d73bd
Added documentation for app.storage.client
Alyxion 06d6393
Removed imports, simplified client availability check
Alyxion bb6f44b
Merge branch 'main' into feature/per_session_data
Alyxion 040ebb8
Updated documentation
Alyxion 8013ea0
Merge remote-tracking branch 'origin/feature/per_session_data' into f…
Alyxion f02d9e9
Removed connection test_clear from
Alyxion c57a93f
Removed random import, not required for demo anymore
Alyxion 0714c51
Merge remote-tracking branch 'nicegui/main' into feature/per_session_…
Alyxion ac4ecb1
Resolved merging conflicts with tab extension
Alyxion edca313
Merge fix
Alyxion 6e85268
Merge fix
Alyxion bad5cec
minimal updates to documentation
rodja c01d0d1
code review
falkoschindler 26ba191
Removed line duplication
Alyxion 9ade1f9
improve clearing of client storage
falkoschindler 44f70c7
Merge branch 'feature/per_session_data' of github.com:Alyxion/nicegui…
falkoschindler 6563825
fix typo
falkoschindler ff58c03
add overview table
falkoschindler 7f856b4
renaming
falkoschindler 0f72368
review documentation
falkoschindler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from nicegui import ui, app | ||
from nicegui.testing import Screen | ||
|
||
|
||
def test_session_state(screen: Screen): | ||
app.storage.session["counter"] = 123 | ||
|
||
def increment(): | ||
app.storage.session["counter"] = app.storage.session["counter"] + 1 | ||
|
||
ui.button("Increment").on_click(increment) | ||
ui.label().bind_text(app.storage.session, "counter") | ||
|
||
screen.open('/') | ||
screen.should_contain('123') | ||
screen.click('Increment') | ||
screen.wait_for('124') |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.