react-native-async-storage-listener
Version:
A wrapper around React Native's AsyncStorage with a listener.
17 lines (16 loc) • 580 B
TypeScript
declare class StorageListener {
private state;
private subscribers;
constructor();
setItem: (value: string, channelKey: string) => void;
getItem: (channelKey: string) => string;
clearItem: (channelKey: string) => void;
getChannels: () => Array<string>;
private notifySubscribers;
addSubscriber: (callback: (state: string) => void, channelKey: string) => any;
removeSubscriber: (key: string) => boolean;
removeAllSubscribers: () => void;
private removeSubscribers;
}
declare const _default: StorageListener;
export default _default;