curious why `Drivers` is `@hidden` and can it be made iterable?
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 32/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- angular, sqlite, typescript
調査の方向性
lib/src/index.tsから始め、特にDriversのexportとdriverOrderに関するコメントを確認してから、リポジトリのドキュメントにあるAngularの例と比較します。Driversの意図された公開ステータスと、反復可能なドライバーの順序付けが要求されたAPIの一部であるかどうかを判断します。動作と推奨される使用方法が明確に決定され、文書化されていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
OK so I'm just returning to some Angular stuff after about a year off and seems like I've arrived just as there are breaking changes required on the storage.
I'm working through the documentation and trying to distill the best practices out of it.
I'm adding in the sqlite support.
Driver Order
Firstly I got stuck a bit reading through the source code to make sure what the correct order of the drivers should be.
I'm aiming to use the sqllite driver, but it seems like it then puts the responsibility of taking control of all the other drivers as well. I didn't know which was the best order to put them in.
Reading through the code I've settled on this:
import { IonicStorageModule } from '@ionic/storage-angular';
import { Drivers } from '@ionic/storage';
import * as CordovaSQLiteDriver from 'localforage-cordovasqlitedriver';
@NgModule({
// snip
imports: [
// snip
IonicStorageModule.forRoot({
driverOrder: [CordovaSQLiteDriver._driver, Drivers.IndexedDB, Drivers.LocalStorage]
}) ],
Drivers Hidden
Which brings me to the second thing - why is the Drivers exported but @hidden (see here)?
This makes it feel like I shouldn't be using it, but I would prefer not to use strings in my list like the comments seem to hint at. It's also used in the example code in the docs.
Also the second code example only adds in one of them, which was confusing:
driverOrder: [CordovaSQLiteDriver._driver, Drivers.IndexedDB]
Drivers Iterable?
Finally, would it be possible / practical to make Drivers iterable? Instead of taking responsibility for getting the order right this time, and having to maintain that in the future, I thought I was being clever to try this:
driverOrder: [CordovaSQLiteDriver._driver, ...Drivers]
But the compiler politely declined that idea with:
Type '{ SecureStorage: string; IndexedDB: string; LocalStorage: string; }' must have a '[Symbol.iterator]()' method that returns an iterator.ts(2488)
- 主要言語
- TypeScript
- スター
- 456
- フォーク
- 97
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ionic-team/ionic-storage のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
ionic-team/ionic-storage#326 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
ionic-team/ionic-storage#325 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
ionic-team/ionic-storage#324 · コメント 4 件 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
ionic-team/ionic-storage#323 · コメント 2 件 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
ionic-team/ionic-storage#322 · コメント 1 件 · リアクション 8 件 ·
ionic-team/ionic-storage の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
NaturalIntelligence/fast-xml-parser#890 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
zsviczian/obsidian-excalidraw-plugin#3000 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
pnpm/get.pnpm.io#68 ·
-
[BUG] Cloudflare KV binding 模式下 kvDriver.list() 沿用 EdgeOne 语义,字段名不匹配导致 key 格式下初始化 500 并耗尽 list 配额対応中かも @wumingzhinu が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
OpenListTeam/OpenList-Worker#125 ·
メンテナーはふだん 2 日以内に返信
-
Android (vision-camera-location): HybridLocationManager never quits its HandlerThread on disposeオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
margelo/react-native-vision-camera#4217 ·
メンテナーはふだん 4 日以内に返信