Skip to content

feat(cache): ICacheStore support async#1986

Open
cipchk wants to merge 4 commits intomasterfrom
issues-2602
Open

feat(cache): ICacheStore support async#1986
cipchk wants to merge 4 commits intomasterfrom
issues-2602

Conversation

@cipchk
Copy link
Member

@cipchk cipchk commented Feb 6, 2026

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Application (the showcase website) / infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

[ ] Yes
[ ] No

Other information

@cipchk
Copy link
Member Author

cipchk commented Feb 6, 2026

Preview is ready!

@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

❌ Patch coverage is 95.45455% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 95.18%. Comparing base (fa31e23) to head (53ea04a).

Files with missing lines Patch % Lines
packages/cache/src/local-storage-cache.service.ts 80.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #1986    +/-   ##
========================================
  Coverage   95.18%   95.18%            
========================================
  Files         270      270            
  Lines        8765     8772     +7     
  Branches     1705     1813   +108     
========================================
+ Hits         8343     8350     +7     
  Misses        335      335            
  Partials       87       87            

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

);
}

private save(type: 'm' | 's', key: string, value: ICache, emitNotify: boolean = true): void {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

save方法,应该要能返回异步promise,毕竟底层的存储可能是异步的,不这样做,调用方就不知道何时save完成了。。同理,其它很多方法,可能都要改成返回异步对象才行。甚至,程序刚运行,在打开底层的存储库时,打开方法,也是异步的,如果不等存储库打开完成,就直接读取或者存储,就会报错。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对外公开的方法,如open,set, get,remove clear等方法,可能都要能返回异步结果。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@delon/cache增加IndexedDB存储方式

2 participants