This repository was archived by the owner on Sep 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathindex.ts
43 lines (39 loc) · 1.4 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import {
Inject,
Injectable,
ModuleWithProviders,
NgModule,
Optional,
SkipSelf } from '@angular/core';
import { AngularFireDatabase } from 'angularfire2/database';
import { AngularFireOfflineDatabase } from './database/database';
import { LOCALFORAGE_PROVIDER, LocalForageToken } from './database/offline-storage/localforage';
import {
LocalUpdateService,
LOCAL_UPDATE_SERVICE_PROVIDER } from './database/offline-storage/local-update-service';
export { AfoListObservable } from './database/list/afo-list-observable';
export { AfoObjectObservable } from './database/object/afo-object-observable';
export { AngularFireOfflineDatabase } from './database/database';
export function ANGULARFIRE_OFFLINE_PROVIDER_FACTORY(parent: AngularFireOfflineDatabase, AngularFireDatabase, token, LocalUpdateService) {
return parent || new AngularFireOfflineDatabase(AngularFireDatabase, token, LocalUpdateService );
};
export const ANGULARFIRE_OFFLINE_PROVIDER = {
provide: AngularFireOfflineDatabase,
deps: [
[new Optional(), new SkipSelf(), AngularFireOfflineDatabase],
AngularFireDatabase,
[new Inject(LocalForageToken)],
LocalUpdateService
],
useFactory: ANGULARFIRE_OFFLINE_PROVIDER_FACTORY
};
@NgModule({
imports: [],
providers: [
ANGULARFIRE_OFFLINE_PROVIDER,
LOCALFORAGE_PROVIDER,
LOCAL_UPDATE_SERVICE_PROVIDER
],
declarations: []
})
export class AngularFireOfflineModule { }