-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
get localstorage support (#2190) #2234
base: develop
Are you sure you want to change the base?
Conversation
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
---|---|---|---|
🔴 | Statements | 52.08% | 263/505 |
🔴 | Branches | 21.75% | 67/308 |
🔴 | Functions | 14.66% | 17/116 |
🔴 | Lines | 53.42% | 242/453 |
Test suite run success
7 tests passing in 1 suite.
Report generated by 🧪jest coverage report action from 0c2fb22
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
---|---|---|---|
🟢 | Statements | 87.77% (-0.07% 🔻) |
3408/3883 |
🟡 | Branches | 69.26% (-0.04% 🔻) |
2300/3321 |
🟢 | Functions | 83.42% (-0.22% 🔻) |
629/754 |
🟢 | Lines | 88.24% (-0.06% 🔻) |
3152/3572 |
Show files with reduced coverage 🔻
St.❔ |
File | Statements | Branches | Functions | Lines |
---|---|---|---|---|---|
🟢 | ... / taipyReducers.ts |
89.49% (-0.97% 🔻) |
81.22% (-0.83% 🔻) |
83.64% (-3.16% 🔻) |
89.92% (-0.91% 🔻) |
Test suite run success
681 tests passing in 47 suites.
Report generated by 🧪jest coverage report action from a98cddf
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this local storage API redéfinition in the browser
Way to invasive for my taste
And I'm not sure a security audit would appreciate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to improve the doc a little bit before you actually merge.
Let's do that together if that works for you.
|
||
def get_local_storage(state: State, *keys: str) -> t.Optional[t.Union[str, t.Dict[str, str]]]: | ||
"""Get local storage value(s). | ||
Arguments: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line skip here.
Can this be called anytime in the app life cycle?
I suspect we should add more details on invoking this API (with the complexity of the keys type).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have not tested every case but it is very early on, only after the state id is initialized.
Arguments: | ||
state (State^): The current user state as received in any callback. | ||
*keys (string): The keys to get from the local storage | ||
Returns: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line skip.
Explanations are pretty weak. Let's spend some time together on this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i am open to any proposal to the doc
This PR has been labelled as "🥶Waiting for contributor" because it has been inactive for more than 14 days. If you would like to continue working on this PR, then please add new commit or another comment, otherwise this PR will be closed in 14 days. For more information please refer to the contributing guidelines. |
Resolve #2190
localStorage.setItem and localStorage.removeItem can be used directly on the browser console to test out the feature