Skip to main content
Module

x/fastro/core/map/mod.ts>Store

Full Stack Framework for Deno, TypeScript, Preact JS and Tailwind CSS
Latest
class Store
import { Store } from "https://deno.land/x/fastro@v0.93.4/core/map/mod.ts";

Constructors

new
Store(options?: StoreOptions)

Type Parameters

K extends string | number | symbol
V

Properties

private
intervalId: number | null
private
isCommitting: boolean
private
map: Map<K, { value: V; expiry?: number; }>
private
options: StoreOptions

Methods

private
cleanUpExpiredEntries(): void
private
saveToGitHub(options: StoreOptions)
private
syncMap()
check(key: K)
clear(): void

Save to github

delete(key: K): boolean

Delete file from repository

forEach(callback: (value: V, key: K) => void): void

Executes a provided function once per each key/value pair in the Map, in insertion order.

get(key: K)

Returns a specified element from the Map object. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map.

has(key: K)
set(
key: K,
value: V,
ttl?: number,
)

Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.

size(): number
sync(interval?: number)

Save the map to the repository periodically at intervals