Skip to content

Added a storage utility #105

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

Merged
merged 3 commits into from
Jun 18, 2024
Merged

Added a storage utility #105

merged 3 commits into from
Jun 18, 2024

Conversation

WebReflection
Copy link
Contributor

This MR exposes yet another handy utility behind the storage name.

It allows users to initiate a persistent IndexedDB based Map that will act synchronously after initialization.

/cc @ntoll

Copy link
Member

@ntoll ntoll left a comment

Choose a reason for hiding this comment

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

:shipit:

<script type="micropython" async>
from polyscript import storage

map = await storage("@polyscript/storage")
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps rename map to store..? To my ears it sounds more natural. Feel free to ignore.

Copy link
Contributor Author

@WebReflection WebReflection Jun 18, 2024

Choose a reason for hiding this comment

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

it's just an example ... you can name it s if you prefer ... I don't mind, though it's literally an instanceof Map https://github.com/pyscript/polyscript/pull/105/files#diff-a497e59c79570ea211b04920b54c45dd1b0a3bcedf9d788222891334008a1c00

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@WebReflection WebReflection merged commit 8c3cf4a into main Jun 18, 2024
2 checks passed
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.

2 participants