1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// SPDX-License-Identifier: 0BSD
import { Blob } from "https://esm.town/v/pomdtr/lowdb?v=17";
import { KeyvLow } from "https://esm.town/v/vladimyr/keyvhqLow";
import { type Store } from "npm:@keyvhq/core";
export type KeyvBlobOptions = {
key?: string;
};
export const blobStore = createStore();
export function createStore<T>(options?: KeyvBlobOptions): Store<T> {
const key = options?.key ?? "keyv";
return new KeyvLow<T>({
adapter: new Blob(key),
});
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
April 1, 2024