Skip to content
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

feat(api): AsyncStorage interfaces #1016

Merged
merged 7 commits into from
Nov 22, 2023
Merged

feat(api): AsyncStorage interfaces #1016

merged 7 commits into from
Nov 22, 2023

Conversation

krizzu
Copy link
Member

@krizzu krizzu commented Oct 19, 2023

Summary

Introducing a core API for Storage implementations - AsyncStorage.
This interface provides a unified and concise API, extending Web Storage API with additional methods for handling multiple entries at the time.

Extension

If a Storage has capabilities beyond basic, provided by AsyncStorage interface, it can be delivered by extending StorageExtension.

Model

The interface provides a way to define user's own model, for type safety

@krizzu krizzu marked this pull request as ready for review October 24, 2023 15:31
@krizzu krizzu requested a review from tido64 as a code owner October 24, 2023 15:31
@krizzu
Copy link
Member Author

krizzu commented Nov 8, 2023

For some reason, I had YN0018 error (wrong checksum) for dependencies, so had to re-run yarn install fresh.

Additionally, what has been done in this PR:

  • core is now named api
  • default-storage-backend renamed to default-storage (we got rid of storage backend term)

@krizzu
Copy link
Member Author

krizzu commented Nov 8, 2023

For review: main change is within api package, everything else is adjustment for package name changes.
@tido64 This one is good for review/discussion

Copy link
Member

@tido64 tido64 left a comment

Choose a reason for hiding this comment

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

This makes sense to me. Thanks for working on it. I left a few nits only.

packages/api/example/ExampleStorage.ts Outdated Show resolved Hide resolved
packages/api/src/AsyncStorage.ts Outdated Show resolved Hide resolved
packages/api/src/index.ts Outdated Show resolved Hide resolved
yarn.lock Outdated Show resolved Hide resolved
@krizzu krizzu enabled auto-merge (squash) November 21, 2023 09:28
@krizzu krizzu disabled auto-merge November 22, 2023 12:03
@krizzu krizzu merged commit 622d505 into main Nov 22, 2023
9 checks passed
@krizzu krizzu deleted the feat/api-v2 branch November 22, 2023 12:03
@AsyncStorageBot
Copy link
Collaborator

🎉 This PR is included in version 1.19.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants