Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feat(useStorageAsync): AddreloadTriggeroption AND Addloadedoption AND Change key to MaybeRefOrGetter<string> #4155

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
Loading
from

Conversation

eed-cn
Copy link

@eed-cn eed-cn commented Aug 16, 2024

Description

Addloadedoption to useStorageAsync , Mainly addresses the issue of initial loading state determination for asynchronous stores

给useStorageAsync添加loaded, 为方便获取初次是否加载成功.
修改 keyMaybeRefOrGetter<string>
添加reloadTrigger选项, 用于触发再次加载配置

Additional context

Asynchronous operations are slow, and with an initial value (initialValue), it's hard to determine if the asynchronous loading is complete.
异步较慢, 又有初始值(initialValue), 不好判断是否异步加载完毕.

修改 keyMaybeRefOrGetter<string> , 目的时在应用场景中更方便灵活

目前应用场景是业务有多个模块的配置信息集中管理, 包括切换用户重新加载配置, 配置更新时也需要重新加载 开始使用的时useIDBKeyval, 后改为useStorageAsync

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. enhancement New feature or request labels Aug 16, 2024
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Aug 16, 2024
@eed-cn eed-cn changed the title feat(useStorageAsync): Addloadedoption feat(useStorageAsync): Addloadedoption AND Change key to MaybeRefOrGetter<string> Aug 16, 2024
@eed-cn eed-cn changed the title feat(useStorageAsync): Addloadedoption AND Change key to MaybeRefOrGetter<string> feat(useStorageAsync): AddreloadTriggeroption AND Addloadedoption AND Change key to MaybeRefOrGetter<string> Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size:M This PR changes 30-99 lines, ignoring generated files.
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.