WinterApplication

Holds the plugins, the application Component and the application Graph.

Applications usually use the Winter object. To use Winter in a library it is recommended to create a library specific object from WinterApplication, so that the library doesn't share its component, graph and plugins with the application.

Example:

// configure the application component
Winter.component {
singleton<GitHubApi> { GitHubApiImpl() }
singleton { RepoListViewModel(instance()) }
}
// open the application graph
val graph = Winter.openGraph()

Classes that can't use constructor injection (e.g. Android activities) can retrieve their dependencies from the application graph with the property delegates of the winter-delegate module.

Inheritors

Constructors

Link copied to clipboard
constructor()
constructor(qualifier: Qualifier = ApplicationScope, block: ComponentBuilderBlock)

Convenient constructor to configure the application Component during initialization.

Properties

Link copied to clipboard

The application component.

Link copied to clipboard

Get the application graph.

Link copied to clipboard

Get the application graph if open otherwise null.

Link copied to clipboard

The plugins registered on the application.

Functions

Link copied to clipboard

Close the application graph.

Link copied to clipboard

Close the application graph if open otherwise do nothing.

Link copied to clipboard
fun component(qualifier: Qualifier = ApplicationScope, block: ComponentBuilderBlock)

Sets the application component by supplying an optional qualifier and a component builder block.

Link copied to clipboard

Create graph from component without registering it as application graph.

Link copied to clipboard

Get application graph if already open otherwise open and return it.

Link copied to clipboard

Open the application component.

Link copied to clipboard