Skip to content

Added an option to set storage engine per store, #63#70

Merged
ai merged 2 commits into
nanostores:mainfrom
Ermad:main
Feb 25, 2026
Merged

Added an option to set storage engine per store, #63#70
ai merged 2 commits into
nanostores:mainfrom
Ermad:main

Conversation

@Ermad

@Ermad Ermad commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

Implements #63

Would allow for usage of sessionStorage vs localStorage per store

@ai

ai commented Feb 23, 2026

Copy link
Copy Markdown
Member

12 bytes looks not so big. Can you update size-limit section in package.json to fix tests?

Adjusted persistentMap test to set storage option before initilization
@Ermad

Ermad commented Feb 23, 2026

Copy link
Copy Markdown
Contributor Author

I made the change.

One difference this makes is a store uses the global storage engine of when it was created, so setPersistentEngine only effects stores created after it was called. Personally I think this behavior makes more sense, but it is a breaking change.

@ai
ai merged commit df7ff83 into nanostores:main Feb 25, 2026
4 checks passed
@ai

ai commented Feb 25, 2026

Copy link
Copy Markdown
Member

@Ermad but what about event engine? How storage will work without events?

I reverted the merge. Can you prepare another PR?

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