Skip to content

Providers

Brod edited this page Jul 15, 2018 · 6 revisions

Providers are used to manage state within your Jagwah Application, they are only constructed once.

Usage

You can add Providers to Jagwah with the Provider() method.

jagwah.Provider(Provider);

Naming

All Providers must be named for dependency injection, appending a $ before the name of the provider is a Jagwah convention but not required.

@Provider('$account')
class AccountProvider {
  constructor() {}
}jagwah.Provider(AccountProvider);
// '$account';