We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
export class MockServerBlobSource implements BlobSource { private readonly _cache = new Map<string, Blob>();
readonly = false;
constructor(readonly name: string) { }
async delete(key: string) { console.log(delete ${key});
delete ${key}
this._cache.delete(key); await deleteImage(key)
}
async get(key: string) { if (this._cache.has(key)) { return this._cache.get(key) as Blob; } else { const blob = await getImage(key) this._cache.set(key, blob); return blob; } }
// eslint-disable-next-line @typescript-eslint/require-await async list() { return Array.from(this._cache.keys()); }
async set(key: string, value: Blob) { this._cache.set(key, value); const formData = new FormData(); formData.append('file_hash', key); formData.append('file', value); await saveImage(formData); return key; } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
export class MockServerBlobSource implements BlobSource {
private readonly _cache = new Map<string, Blob>();
readonly = false;
constructor(readonly name: string) { }
async delete(key: string) {
console.log(
delete ${key}
);}
async get(key: string) {
if (this._cache.has(key)) {
return this._cache.get(key) as Blob;
} else {
const blob = await getImage(key)
this._cache.set(key, blob);
return blob;
}
}
// eslint-disable-next-line @typescript-eslint/require-await
async list() {
return Array.from(this._cache.keys());
}
async set(key: string, value: Blob) {
this._cache.set(key, value);
const formData = new FormData();
formData.append('file_hash', key);
formData.append('file', value);
await saveImage(formData);
return key;
}
}
The text was updated successfully, but these errors were encountered: