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

v0.8.0 - refactor the Storage constructor() to take in an object instead #10

Conversation

nicolaerusan
Copy link
Contributor

Note: This would be a breaking change and require updating the version and the docs.

Currently, the constructor of Storage required you to pass arguments:

const storage = new Storage('sync', ['accessToken']);

It's likely cleaner to make it an object, so you can do something like:

const storage = new Storage({
  secretKeyList: [...]
})

src/index.ts Outdated
@@ -17,6 +17,11 @@ export type StorageCallbackMap = Record<string, StorageWatchCallback>

const hasWindow = typeof window !== "undefined"

export type StorageConfig = {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should infer type instead. I will refactor this a bit.

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.

Overall lgtm 👍

@louisgv louisgv changed the title Refactoring the Storage constructor() to take in an object instead feat: refactor the Storage constructor() to take in an object instead Jul 15, 2022
@louisgv louisgv changed the title feat: refactor the Storage constructor() to take in an object instead v: 0.8.0 - refactor the Storage constructor() to take in an object instead Jul 15, 2022
@louisgv louisgv merged commit f9c1688 into PlasmoHQ:main Jul 15, 2022
@louisgv louisgv changed the title v: 0.8.0 - refactor the Storage constructor() to take in an object instead v0.8.0 - refactor the Storage constructor() to take in an object instead Jul 15, 2022
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