-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Labels
enhancementNew feature or requestNew feature or request
Description
What problem does this new feature solve?
It would be nice to have the ability to pass an adapter to use the async storage library of choice like mmkv, similar to the clipboard property you guys have.
Describe the solution you'd like
import { MMKV } from 'react-native-mmkv';
const mmkv = new MMKV();
export interface AsyncStorageAdapter {
getItem: (key: string) => Promise<string | null>;
setItem: (key: string, value: string) => Promise<void>;
removeItem: (key: string) => Promise<void>;
// Optional: Additional methods like clear() or multiGet() if needed by AppKit
}
// Custom storage adapter implementation
const customStorageAdapter: AsyncStorageAdapter = {
getItem: async (key: string) => {
return mmkv.getString(key) ?? null;
},
setItem: async (key: string, value: string) => {
mmkv.set(key, value);
},
removeItem: async (key: string) => {
mmkv.delete(key);
},
};
createAppKit({
storageAdapter: customStorageAdapter, // Pass the custom storage adapter
// ... other params
});
yevhenjl
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request