azu / kvs

Lightweight key-value storage library for Browser, Node.js, and In-Memory.
MIT License
182 stars 6 forks source link

TypeScript: Schema instead of <K,V> #1

Closed azu closed 4 years ago

azu commented 4 years ago

Currently use <K,V> type for initializing.

export const kvsMemoryStorage = async <K extends KVSStorageKey, V extends JsonValue>(
    options: KvsLocalStorageOptions<K, V>
): Promise<KvsStorage<K, V>> => {
    return kvsStorage({
        ...options,
        storage: localstorage
    });
};

But, Schamea is useful, I Think

Reason

Related