@mysten/dapp-kit
Version:
A collection of React hooks and components for interacting with the Sui blockchain and wallets.
20 lines (17 loc) • 410 B
text/typescript
// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
import type { StateStorage } from 'zustand/middleware';
export function createInMemoryStore(): StateStorage {
const store = new Map();
return {
getItem(key: string) {
return store.get(key);
},
setItem(key: string, value: string) {
store.set(key, value);
},
removeItem(key: string) {
store.delete(key);
},
};
}