diff options
author | crupest <crupest@outlook.com> | 2020-07-31 01:16:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-31 01:16:10 +0800 |
commit | fe950cad28ec6ff7bf6f399ddd31448180bc7601 (patch) | |
tree | d58a7c9a33a4cf16b128d71b94edf0110298bd13 /Timeline/ClientApp/src/app/data/common.ts | |
parent | d900c1b8c012970db491f421e1975f5de3b450f3 (diff) | |
parent | b8cf8379358958c1155442d0526bbfc8c4d65ded (diff) | |
download | timeline-fe950cad28ec6ff7bf6f399ddd31448180bc7601.tar.gz timeline-fe950cad28ec6ff7bf6f399ddd31448180bc7601.tar.bz2 timeline-fe950cad28ec6ff7bf6f399ddd31448180bc7601.zip |
Merge pull request #127 from crupest/offline-post
Add feature of offline post cache.
Diffstat (limited to 'Timeline/ClientApp/src/app/data/common.ts')
-rw-r--r-- | Timeline/ClientApp/src/app/data/common.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Timeline/ClientApp/src/app/data/common.ts b/Timeline/ClientApp/src/app/data/common.ts index 7f3f4e93..9f985ce6 100644 --- a/Timeline/ClientApp/src/app/data/common.ts +++ b/Timeline/ClientApp/src/app/data/common.ts @@ -1,4 +1,18 @@ +import localforage from 'localforage';
+
+export const dataStorage = localforage.createInstance({
+ name: 'data',
+ description: 'Database for offline data.',
+ driver: localforage.INDEXEDDB,
+});
+
export interface BlobWithUrl {
blob: Blob;
url: string;
}
+
+export class ForbiddenError extends Error {
+ constructor(message?: string) {
+ super(message);
+ }
+}
|