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

fix: storage pify errorFirst #40

Merged
merged 1 commit into from
Sep 8, 2023

Conversation

adrienbrault
Copy link
Contributor

It turns out that #38 was not enough.

I kept getting the result ({} in that screenshot) rejected when using plasmoStorage.get:

CleanShot 2023-07-25 at 11 51 09@2x

While using chrome.storage.local.get directly would work fine.

https://developer.chrome.com/docs/extensions/reference/storage/#method-StorageArea-get documents the callback as (items: object) => void, no error is passed.

https://github.com/sindresorhus/pify#errorfirst is false by default, and mentions:

You'll want to set this to false if you're dealing with an API that doesn't have an error as the first argument, like fs.exists(), some browser APIs, Chrome Extension APIs, etc.

Copy link
Contributor

@louisgv louisgv left a comment

Choose a reason for hiding this comment

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

LGTM - thanks for the PR @adrienbrault sorry for the delay, I have been away for a bit 😅

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