doc: added downloadImage function

This commit is contained in:
Leon Xu committed 2023-01-30 17:22:31 -08:00
1 parent 2fd5641695
commit 8168ee7c0b
1 file changed
+5
+5
View File
@@ -1,3 +1,4 @@
import FileSaver from "file-saver";
import { surpriseMePrompts } from "../constants";
export function getRandomPrompt(prompt) {
@@ -8,3 +9,7 @@ export function getRandomPrompt(prompt) {
return randomPrompt;
}
export async function downloadImage(_id, photo) {
FileSaver.saveAs(photo, `download-${_id}.jpg`);
}