Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

feat: replace localStorage with StorageAdapter #14

Merged
merged 12 commits into from
Feb 23, 2024
Merged

Conversation

drichar
Copy link
Contributor

@drichar drichar commented Feb 23, 2024

This updates the core library by abstracting access to local storage, to handle SSR environments gracefully. The StorageAdapter class includes fallbacks for the getItem and setItem methods if window is undefined.

Next.js and Nuxt example apps have been added to demonstrate the library working in frameworks that support SSR.

Closes #13

@drichar drichar merged commit 246f133 into main Feb 23, 2024
1 check passed
@drichar drichar deleted the ssr-storage-adapter branch February 23, 2024 09:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent server side (SSR) initialization
1 participant