react-code-dataset / nivo /packages /express /src /memory-storage.ts
Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
raw
history blame
450 Bytes
import { ChartProps, ChartType } from '@nivo/static'
export interface StorageEntry<T extends ChartType> {
type: T
props: ChartProps<T>
url: string
}
const store: Record<string, StorageEntry<ChartType>> = {}
export const set = (key: string, value: StorageEntry<ChartType>) => {
store[key] = value
}
export const get = (key: string): StorageEntry<ChartType> | undefined => {
return store[key]
}
export const dump = () => store