feat(gun): add collection enum

This commit is contained in:
Johannes Millan 2019-10-21 03:20:19 +02:00
parent a3e30e4434
commit e8a6523cd9

View file

@ -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() {