mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
feat(gun): add collection enum
This commit is contained in:
parent
a3e30e4434
commit
e8a6523cd9
1 changed files with 6 additions and 2 deletions
|
|
@ -3,7 +3,7 @@ import {Injectable} from '@angular/core';
|
|||
import * as Gun from 'gun';
|
||||
import 'gun/lib/rindexed.js';
|
||||
import 'gun/lib/open.js';
|
||||
import {BehaviorSubject, Observable, ReplaySubject} from 'rxjs';
|
||||
import {BehaviorSubject} from 'rxjs';
|
||||
|
||||
// console.log(Gun);
|
||||
// console.log(window['RindexedDB']);
|
||||
|
|
@ -14,6 +14,10 @@ interface State {
|
|||
};
|
||||
}
|
||||
|
||||
enum GunCollection {
|
||||
tasks = 'tasks'
|
||||
}
|
||||
|
||||
const gun = new Gun({
|
||||
// tslint:disable-next-line
|
||||
store: window['RindexedDB']
|
||||
|
|
@ -27,7 +31,7 @@ export class GunService {
|
|||
public tasks$: BehaviorSubject<any[]> = new BehaviorSubject([]);
|
||||
|
||||
get t() {
|
||||
return gun.get('tasks');
|
||||
return gun.get(GunCollection.tasks);
|
||||
}
|
||||
|
||||
constructor() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue