@dig-platform/dig-app
v0.2.1
Published
The vast majority of apps have the same basic platform dependencies. DigApps creates a lightweight, immutable app container that provides access to these resources in a consistent way.
Downloads
47
Readme
DigApps
The vast majority of apps have the same basic platform dependencies. DigApps creates a lightweight, immutable app container that provides access to these resources in a consistent way.
Installation
npm install @dig-platform/dig-app
Getting started
DigApps are based on configuration, which should implement DigConfig and adapters for the other resources your app requires.
@Injectable({
providedIn: 'root'
})
export class TodoService {
public readonly app: DigApp = DigPlatform.factory({
config: {
id: 'todo',
status: 'plan',
title: 'Todo',
description: 'Beginner tutorial',
icon: 'construct',
},
adapters: {
db: new AngularFirestoreAdapter(this.afs),
auth: new AngularFireAuthAdapter(this.auth),
state: new DigStateAdapter({
todos: []
})
}
});
constructor(private afs: AngularFirestore, private auth: AngularFireAuth) {
}
}
App Resources
Configuration
DigApps are configuration driven, which makes integration and extension as easy as possible.
User authentication
You can optionally load an authentication adapter which will load the auth state from a wide range of providers into your DigApp.
Database
At the time of writing we only support Firebase Firestore, but you can use our generic adapter to integrate with other data sources.
File Storage
At the time of writing we only support Firebase Storage, but you can use our generic adapter to integrate with other data sources.
State
DigApp ships with a simple Rxjs based state container. An Ngrx adapter is in development.