Skip to content

dig-platform/dig-app

Repository files navigation

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

DigApps are configuration driven, which makes integration and extension as easy as possible.

You can optionally load an authentication adapter which will load the auth state from a wide range of providers into your DigApp.

At the time of writing we only support Firebase Firestore, but you can use our generic adapter to integrate with other data sources.

At the time of writing we only support Firebase Storage, but you can use our generic adapter to integrate with other data sources.

DigApp ships with a simple Rxjs based state container. An Ngrx adapter is in development.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published