Skip to content

five-on-it / apps/client/src/renderer/level-cache / loadByHash

Function: loadByHash() ​

loadByHash<T>(url, hash, parse, options?): Promise<{ source: "cache" | "network"; value: T; }>

Defined in: apps/client/src/renderer/level-cache.ts:152

A file named by its SHA-256: from this browser's store when it was kept before (and still matches its hash and parse reads it), else downloaded from url, checked against the hash, read and kept; what names it in the error a file that is not it raises.

Type Parameters ​

T ​

T

Parameters ​

url ​

string

hash ​

string

parse ​

(bytes) => T

options? ​

bytes? ​

number

progress? ​

(received, total) => void

what? ​

string

Returns ​

Promise<{ source: "cache" | "network"; value: T; }>