mineral-dart / core

🧡 The neuralgic heart of the application, this module gathers all the functionalities of the framework.
https://mineral-foundation.org
MIT License
27 stars 8 forks source link

Implement provider services #153

Closed LeadcodeDev closed 5 months ago

LeadcodeDev commented 6 months ago

Overview

Service providers are designed to improve the separation of your modules by delegating the initialization and registration of their respective events, commands (and more) within their own context.

Proposal

final class FooProvider extends ProviderContract {
  FutureOr<void> boot() {
    // Called when provider was loaded by the framework
  }

  FutureOr<void> ready() {
    // Called when provider was ready to use
  }

  FutureOr<void> dispose() {
    // Called when provider was unloaded
  }
}