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

feat(swap): define base storage type to be used for web & mobile #2705

Merged
merged 1 commit into from
Sep 25, 2023

Conversation

neuodev
Copy link
Contributor

@neuodev neuodev commented Sep 25, 2023

// For mobile  
swapStorageMaker() // use async storage for react native 
// For web
swapStorageMaker({
   storage: {
     setItem: promisify(localStorage.setItem)
  }
})

@neuodev neuodev requested a review from stackchain September 25, 2023 08:15
@stackchain
Copy link
Member

hey @neuodev LGFN, later I'll be adding a storage kind to the types, so if kind: 'local' | 'whatever' we can defined {kind: 'local', getItem(key: string): string | null} | {kind: 'async-storage', getItem:(key: string): Promise<string | null> so you guys don't need to promisify everything.

@stackchain stackchain added this to the 5.0.0 milestone Sep 25, 2023
@stackchain stackchain merged commit 48044b1 into develop Sep 25, 2023
@stackchain stackchain deleted the ahmed/storage-web branch September 25, 2023 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants