-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(capacitor): migrate to new version
- replace storage with preferences plugin
- Loading branch information
1 parent
736f366
commit 19dacfa
Showing
1 changed file
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import { Storage as storage } from '@capacitor/storage'; | ||
import { Preferences } from '@capacitor/preferences'; | ||
import { type Storage } from 'redux-persist'; | ||
|
||
export const capacitorStorage: Storage = { | ||
getItem: async (key: string) => { | ||
const { value } = await storage.get({ key }); | ||
const { value } = await Preferences.get({ key }); | ||
return value || ''; | ||
}, | ||
removeItem: async (key: string) => { | ||
return storage.remove({ key }); | ||
return Preferences.remove({ key }); | ||
}, | ||
setItem: async (key: string, value: string) => { | ||
return storage.set({ key, value }); | ||
return Preferences.set({ key, value }); | ||
}, | ||
}; |