Skip to content

Application lifecycle #1

@dmitry-korolev

Description

@dmitry-korolev

Problem and motivation:
Currently, an application starts when created. That forces the developer to create wrappers to delay the initialization. Also, there is no way to "destroy" an application (force unsubscribe all listeners and let the GC do its work). Finally, "dependencies" mechanism looks utterly useless.

Solution:

  • Remove dependencies field from createApp config.
  • Introduce two methods to the application: init and destroy.
  • init method should initialize modules with provided dependencies, start an engine and dispatch a special init event.
  • Application state still should be subscribable at any time.
  • destroy method should unsubscribe all store subscriptions and dispatch a special destroy event.

Metadata

Metadata

Labels

RFCRequest for commentsenhancementNew feature or requestquestionFurther information is requested

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions