Skip to content

Instantly share code, notes, and snippets.

@indatawetrust
Created December 15, 2019 16:12
Show Gist options
  • Save indatawetrust/780d01b5b02af17e0e381c3e7e7cc75a to your computer and use it in GitHub Desktop.
Save indatawetrust/780d01b5b02af17e0e381c3e7e7cc75a to your computer and use it in GitHub Desktop.
capacitor auth storage for featherjs
import { Plugins } from "@capacitor/core";
const { Storage } = Plugins;
export default class CapacitorStorage {
static async getItem(key: string) {
const { value } = (await Storage.get({ key })) || { value: null };
return value;
}
static setItem(key: string, value: any) {
return Storage.set({
key,
value
});
}
static removeItem(key: string) {
return Storage.remove({ key });
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment